Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Merge pull request #110 from c42engineering/issue-103"

Turns out this change is significantly backward-incompatible that we're
going to have to wait for rspec-mocks-3 to release it (or similar)

This reverts commit 6e23ca9, reversing
changes made to 117f2cb.
  • Loading branch information...
commit 3bb19cbcf7e5f0e437cec56811840cdfa93b6cb4 1 parent 6e23ca9
@dchelimsky dchelimsky authored
View
4 lib/rspec/mocks/message_expectation.rb
@@ -54,10 +54,6 @@ def expected_args
@argument_expectation.args
end
- def at_least_once?
- @at_least && @expected_received_count == 1
- end
-
# @overload and_return(value)
# @overload and_return(first_value, second_value)
# @overload and_return(&block)
View
3  lib/rspec/mocks/proxy.rb
@@ -114,9 +114,6 @@ def record_message_received(message, *args, &block)
def message_received(message, *args, &block)
expectation = find_matching_expectation(message, *args)
stub = find_matching_method_stub(message, *args)
- if stub && expectation && expectation.at_least_once?
- method_double[message].stubs.delete(stub)
- end
if (stub && expectation && expectation.called_max_times?) || (stub && !expectation)
expectation.increase_actual_received_count! if expectation && expectation.actual_received_count_matters?
View
9 spec/rspec/mocks/stubbed_message_expectations_spec.rb
@@ -43,14 +43,5 @@
double.foo(3)
expect { double.rspec_verify }.to raise_error(/expected: \(4\)\s+got: \(3\)/)
end
-
- it "passes when at least once method is called more than once " do
- double = double("mock")
- double.stub(:random_call).with(1).and_return("stub")
- double.should_receive(:random_call).with(1).at_least(:once).and_return("expectation")
- double.random_call(1).should eq("expectation")
- double.random_call(1).should eq("expectation")
- double.rspec_verify
- end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.