Sha256: 031852ec78c97b667c8cab4176b41dca9e5eb6283dbb3856b4ea60dbcdf953e9

Contents?: true

Size: 736 Bytes

Versions: 32

Compression:

Stored size: 736 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 include "1 example, 0 failures"

Version data entries

32 entries across 32 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 features/mocks/stub_implementation.feature
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/features/mocks/stub_implementation.feature
rspec-1.3.2 features/mocks/stub_implementation.feature
rspec-1.3.1 features/mocks/stub_implementation.feature
rspec-1.3.1.rc features/mocks/stub_implementation.feature
rspec-1.3.0 features/mocks/stub_implementation.feature
hubbub-0.0.11 lib/vendor/plugins/rspec/features/mocks/stub_implementation.feature
hubbub-0.0.10 lib/vendor/plugins/rspec/features/mocks/stub_implementation.feature
hubbub-0.0.9 lib/vendor/plugins/rspec/features/mocks/stub_implementation.feature
hubbub-0.0.8 lib/vendor/plugins/rspec/features/mocks/stub_implementation.feature
hubbub-0.0.6 lib/vendor/plugins/rspec/features/mocks/stub_implementation.feature
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/features/mocks/stub_implementation.feature
media-path-0.1.2 vendor/rspec/features/mocks/stub_implementation.feature
simple-templater-0.0.1.3 vendor/rspec/features/mocks/stub_implementation.feature
pupu-0.0.2.pre vendor/rspec/features/mocks/stub_implementation.feature
media-path-0.1.1.pre vendor/rspec/features/mocks/stub_implementation.feature
simple-templater-0.0.1.2 vendor/rspec/features/mocks/stub_implementation.feature
media-path-0.1.1 vendor/rspec/features/mocks/stub_implementation.feature
simple-templater-0.0.1.1 vendor/rspec/features/mocks/stub_implementation.feature
pupu-0.0.2 vendor/rspec/features/mocks/stub_implementation.feature