Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing method called on nil warning

  • Loading branch information...
commit 251bf2a6ecda33be486f080810ebf56af2372f61 1 parent 235c8cc
@preethiramdev preethiramdev authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 spec/rspec/mocks/stubbed_message_expectations_spec.rb
View
13 spec/rspec/mocks/stubbed_message_expectations_spec.rb
@@ -45,11 +45,12 @@
end
it "passes when at least once method is called more than once " do
- @mock.stub(:random_call).with(1).and_return("stub")
- @mock.should_receive(:random_call).with(1).at_least(:once).and_return("expectation")
- @mock.random_call(1).should eq("expectation")
- @mock.random_call(1).should eq("expectation")
- @mock.rspec_verify
- end
+ 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.