To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!More about adding a collaborator
expect a message on any instance of a class
any_instance.should_receive to set an expectation that one (and only
one) instance of a class receives a message before the example is completed.
The spec will fail if no instance receives a message.
- expect a message on any instance of a class
a file named "example_spec.rb" with:
describe "any_instance.should_receive" do it "verifies that one instance of the class receives the message" do Object.any_instance.should_receive(:foo).and_return(:return_value) o = Object.new o.foo.should eq(:return_value) end end
- the examples should all pass
Last published over 4 years ago by dchelimsky.
RSpec Mocks settings