Sha256: 5dc9ce307a4c8f99e6cbba49d59182ebd1105614f6e8f9a2c0b2bd66f6512b90

Contents?: true

Size: 716 Bytes

Versions: 5

Compression:

Stored size: 716 Bytes

Contents

Feature: Spec and test together

  As an RSpec user
  I want to use stubs and mocks together

  Scenario: stub in before
    Given a file named "stub_and_mocks_spec.rb" with:
      """
      require 'rspec/expectations'

      Rspec.configure do |config|
        config.mock_framework = :rspec
      end

      describe "a stub in before" do
        before(:each) do
          @messenger = mock('messenger').as_null_object
        end

        it "a" do
          @messenger.should_receive(:foo).with('first')
          @messenger.foo('second')
          @messenger.foo('third')
        end
      end
      """
    When I run "rspec stub_and_mocks_spec.rb -fs"
    Then I should see "'messenger' expected :foo with"

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
rspec-mocks-2.0.0.beta.4 features/mocks/mix_stubs_and_mocks.feature
rspec-mocks-2.0.0.beta.3 features/mocks/mix_stubs_and_mocks.feature
rspec-mocks-2.0.0.beta.2 features/mocks/mix_stubs_and_mocks.feature
rspec-mocks-2.0.0.beta.1 features/mocks/mix_stubs_and_mocks.feature
rspec-core-2.0.0.a10 features/mocks/mix_stubs_and_mocks.feature