Sha256: 4f7ad69a1937ea088c59f3a2b817136662d53fcfa4ae43367a86c8998bef8a09

Contents?: true

Size: 765 Bytes

Versions: 13

Compression:

Stored size: 765 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:
      """ruby
      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

13 entries across 13 versions & 6 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-mocks-2.13.0/features/message_expectations/any_instance.feature
sshp-0.0.2 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/features/message_expectations/any_instance.feature
sshp-0.0.1 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/features/message_expectations/any_instance.feature
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/features/message_expectations/any_instance.feature
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/features/message_expectations/any_instance.feature
rspec-mocks-2.13.1 features/message_expectations/any_instance.feature
vagrant-actionio-0.0.9 vendor/bundle/gems/rspec-mocks-2.13.0/features/message_expectations/any_instance.feature
rspec-mocks-2.13.0 features/message_expectations/any_instance.feature
remq-0.0.4 vendor/bundle/gems/rspec-mocks-2.12.2/features/message_expectations/any_instance.feature
remq-0.0.3 vendor/bundle/gems/rspec-mocks-2.12.2/features/message_expectations/any_instance.feature
rspec-mocks-2.12.2 features/message_expectations/any_instance.feature
rspec-mocks-2.12.1 features/message_expectations/any_instance.feature
rspec-mocks-2.12.0 features/message_expectations/any_instance.feature