Sha256: 3049ca56c102ecd4731ea8f85289efb99241e8f202e254163a5cf77c385f2d7d

Contents?: true

Size: 734 Bytes

Versions: 15

Compression:

Stored size: 734 Bytes

Contents

Feature: stub implementation

  As an rspec user, I want to stub a complete implementation, not just a
  return value.
  
  Scenario: stub implementation
    Given a file named "stub_implementation.rb" with:
      """
      describe "a stubbed implementation" do
        it "works" do
          object = Object.new
          object.stub(:foo) do |arg|
            if arg == :this
              "got this"
            elsif arg == :that
              "got that"
            end
          end
          
          object.foo(:this).should == "got this"
          object.foo(:that).should == "got that"
        end
      end
      """
    When I run "spec stub_implementation.rb"
    Then the stdout should match "1 example, 0 failures"

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
rspec-core-2.0.0.beta.3 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.beta.2 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.beta.1 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a10 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a9 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a8 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a7 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a6 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a5 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a4 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a3 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a2 features-pending/mocks/stub_implementation.feature
rspec-core-2.0.0.a1 features-pending/mocks/stub_implementation.feature
rspec-1.2.7 features/mocks/stub_implementation.feature
rspec-1.2.8 features/mocks/stub_implementation.feature