lib/bourne/api.rb in bourne-1.3.2 vs lib/bourne/api.rb in bourne-1.4.0
- old
+ new
@@ -39,11 +39,11 @@
@expectation = Expectation.new(@mock, @expected_method_name)
@expectations.each do |method, args, block|
@expectation.send(method, *args, &block)
end
- @expectation.invocation_count = invocation_count
+ invocation_count.times { @expectation.invoke }
@expectation.verified?
end
def does_not_match?(mock)
raise InvalidHaveReceived.new("should_not have_received(:#{@expected_method_name}) is invalid, please use" +
@@ -70,10 +70,10 @@
end
end
def invocations
Mockery.instance.invocations.select do |invocation|
- invocation.mock.equal?(@mock)
+ invocation.mock.equal?(@mock) || invocation.mock.mocha.equal?(@mock)
end
end
def matching_stubs
Mockery.instance.stubba.stubba_methods.select do |method|