Sha256: 451e36f2fe6d5729b01272dbc69df6ff5ad94d3804907bbcee960fec3e037aeb

Contents?: true

Size: 816 Bytes

Versions: 7

Compression:

Stored size: 816 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_spec.rb" with:
      """
      RSpec.configure do |c|
        c.mock_with :rspec
      end

      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 "rspec ./stub_implementation_spec.rb"
    Then the output should contain "1 example, 0 failures"

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rspec-mocks-2.0.0.rc features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.22 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.20 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.19 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.18 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.17 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.16 features/stubs/stub_implementation.feature