Sha256: 051983c3eebd4f97a030ee5b2578b896f231201aaa61877cfa4a8186235d4ab8

Contents?: true

Size: 603 Bytes

Versions: 38

Compression:

Stored size: 603 Bytes

Contents

Feature: Spy on an unstubbed method

  Using have_received on an unstubbed method will never pass, so rspec-mocks
  issues a helpful error message.

  Scenario: fail to verify a stubbed method
    Given a file named "failed_spy_spec.rb" with:
      """ruby
      describe "have_received" do
        it "raises a helpful error for unstubbed methods" do
          object = Object.new
          object.object_id
          object.should have_received(:object_id)
        end
      end
      """
    When I run `rspec failed_spy_spec.rb`
    Then the output should contain "that method has not been stubbed"

Version data entries

38 entries across 38 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
rspec-mocks-2.99.4 features/spies/spy_unstubbed_method.feature
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-mocks-2.14.6/features/spies/spy_unstubbed_method.feature
rspec-mocks-2.99.3 features/spies/spy_unstubbed_method.feature
rspec-mocks-2.99.2 features/spies/spy_unstubbed_method.feature
dxruby_rp5-0.0.4 spec/vendor/rspec-mocks-2.14.4/features/spies/spy_unstubbed_method.feature
rspec-mocks-2.99.1 features/spies/spy_unstubbed_method.feature
rspec-mocks-2.99.0 features/spies/spy_unstubbed_method.feature
rspec-mocks-2.99.0.rc1 features/spies/spy_unstubbed_method.feature
rspec-mocks-2.14.6 features/spies/spy_unstubbed_method.feature
rspec-mocks-2.99.0.beta2 features/spies/spy_unstubbed_method.feature
rspec-mocks-2.14.5 features/spies/spy_unstubbed_method.feature
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-mocks-2.14.4/features/spies/spy_unstubbed_method.feature