Sha256: 4c60b60fd429a3f99b13c6555d8d221ecfc614dab76ad15af23e71501fa8c16a

Contents?: true

Size: 801 Bytes

Versions: 5

Compression:

Stored size: 801 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

5 entries across 5 versions & 1 rubygems

Version Path
rspec-mocks-2.0.0.beta.8 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.7 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.6 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.5 features/stubs/stub_implementation.feature
rspec-mocks-2.0.0.beta.4 features/stubs/stub_implementation.feature