Sha256: 784da2751f2d527fe7f95d91115ee48b128fd1a498b6ec913b9b0990aad8410c

Contents?: true

Size: 803 Bytes

Versions: 7

Compression:

Stored size: 803 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 I should see "1 example, 0 failures"

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rspec-mocks-2.0.0.beta.15 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.14 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.13 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.12 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.11 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.10 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.9 features/stubs/stub_implementation.feature