Sha256: 1cd7f0956037433effe56558dabb715b2b1c14157645d71659fe2bf4753776c3

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 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::Core.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 the stdout should match "expected :foo with (\"first\") but received it with ([\"second\"], [\"third\"])"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-core-2.0.0.a5 features/mocks/mix_stubs_and_mocks.feature
rspec-core-2.0.0.a4 features/mocks/mix_stubs_and_mocks.feature
rspec-core-2.0.0.a3 features/mocks/mix_stubs_and_mocks.feature