lib/caricature/isolator.rb in caricature-0.7.0 vs lib/caricature/isolator.rb in caricature-0.7.1

- old
+ new

@@ -54,11 +54,11 @@ # an_isolation.class.did_receive?(:a_method).with(3, "a").should.be.successful # # You will probably be using this method only when you're interested in whether a method has been called # during the course of the test you're running. def did_receive?(method_name, &block) - isolation_context.class_verify method_name + isolation_context.class_verify method_name, &block end end # mixes in the class methods of this module when it gets included in a class. @@ -127,11 +127,11 @@ # an_isolation.did_receive?(:a_method).with(3, "a").should.be.successful # # You will probably be using this method only when you're interested in whether a method has been called # during the course of the test you're running. def did_receive?(method_name, &block) - isolation_context.verify method_name + isolation_context.verify method_name, &block end # Verifies whether the specified class method has been called # You can specify constraints in the block # @@ -156,10 +156,10 @@ # Initializes the underlying subject # It expects the constructor parameters if they are needed. def with_subject(*args, &b) isolation_context.instance = self.class.superclass.new *args - yield self if block_given? + b.call self if b self end end \ No newline at end of file