Sha256: 75d7eca38f14ef3228c044e0aadfa115c804e0289c3cf1c797a7ee1759db3971

Contents?: true

Size: 776 Bytes

Versions: 4

Compression:

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rspec-core-2.0.0.a9 features/mocks/mix_stubs_and_mocks.feature
rspec-core-2.0.0.a8 features/mocks/mix_stubs_and_mocks.feature
rspec-core-2.0.0.a7 features/mocks/mix_stubs_and_mocks.feature
rspec-core-2.0.0.a6 features/mocks/mix_stubs_and_mocks.feature