Sha256: 6d9f88721bae88ebdf5c128236b842b23899c3eae034db60f92c6874381bec46

Contents?: true

Size: 643 Bytes

Versions: 4

Compression:

Stored size: 643 Bytes

Contents

Feature: Spec and test together

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

  Scenario: stub in before
    Given the following spec:
      """
      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 it with the spec command --format nested
    Then the stdout should match "expected :foo with (\"first\") but received it with ([\"second\"], [\"third\"])"

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
dchelimsky-rspec-1.1.99.13 features/mocks/mix_stubs_and_mocks.feature
rspec-1.2.0 features/mocks/mix_stubs_and_mocks.feature
rspec-1.2.1 features/mocks/mix_stubs_and_mocks.feature
rspec-1.2.2 features/mocks/mix_stubs_and_mocks.feature