spec/rspec/mocks/matchers/receive_spec.rb in rspec-mocks-2.14.5 vs spec/rspec/mocks/matchers/receive_spec.rb in rspec-mocks-2.14.6

- old
+ new

@@ -7,10 +7,14 @@ def verify_all ::RSpec::Mocks.space.verify_all end + def reset_all + ::RSpec::Mocks.space.reset_all + end + shared_examples_for "a receive matcher" do |*options| it 'allows the caller to configure how the subject responds' do wrapped.to receive(:foo).and_return(5) expect(receiver.foo).to eq(5) end @@ -95,9 +99,11 @@ wrapped.to receive(:foo) expect { verify_all }.to raise_error(RSpec::Mocks::MockExpectationError) + + reset_all end it "reports the line number of expectation of unreceived message", :pending => options.include?(:does_not_report_line_num) do expected_error_line = __LINE__; wrapped.to receive(:foo)