Class: Assertion::True
Overview
Assertion::True
Direct Known Subclasses
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *a, &b) ⇒ Object (private)
TODO: Not sure about the raises here.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/quarry/assert.rb', line 59 def method_missing(sym, *a, &b) #case sym #when :raise?, :raises? # begin # @delegate.call #yield # assert false, "Expected #{a[0]} to be raised" # rescue Exception => e # assert a[0] === e, "Expected #{a[0]} to be raised, but got #{e.class}" # return e # end #else assert(@delegate.__send__(sym, *a, &b), (@delegate, sym, *a, &b)) #end end |