Sha256: 4003dba1d113781c8162d3d95f87882cb72bc943c3bd38b8037095a10deb2fea
Contents?: true
Size: 702 Bytes
Versions: 4
Compression:
Stored size: 702 Bytes
Contents
Feature: expect a message on any instance of a class Use `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. Scenario: expect a message on any instance of a class Given 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 """ When I run `rspec example_spec.rb` Then the examples should all pass
Version data entries
4 entries across 4 versions & 1 rubygems