Sha256: 395f3df85e07541c3379b1908fc7999a1f38682621d3adf0db15af19cb58f5b7

Contents?: true

Size: 761 Bytes

Versions: 150

Compression:

Stored size: 761 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.
  
  The spec will fail if no instance receives a message.

  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

150 entries across 96 versions & 14 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
classiccms-0.7.5 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.11.3/features/message_expectations/any_instance.feature
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.11.3/features/message_expectations/any_instance.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
classiccms-0.6.9 vendor/bundle/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
classiccms-0.6.9 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature
classiccms-0.6.8 vendor/bundle/gems/rspec-mocks-2.10.1/features/message_expectations/any_instance.feature
classiccms-0.6.8 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature
classiccms-0.6.7 vendor/bundle/gems/rspec-mocks-2.9.0/features/message_expectations/any_instance.feature