Sha256: 46a0f029d442066bbb073cbcf0928dcc75ea88f6c35ab3f3485287ea29be3e58

Contents?: true

Size: 863 Bytes

Versions: 13

Compression:

Stored size: 863 Bytes

Contents

Feature: stub with argument constraints

  You can further specify the behavior by constraining the type,
  format and/or number of arguments with the `#with()` method 
  chained off of `#stub()`
  
  Scenario: an_instance_of argument matcher
    Given a file named "stub_an_instance_of_args_spec.rb" with:
      """ruby
      describe "stubbed an_instance_of() args spec" do
        it "works" do
          object = Object.new
          object.stub(:foo).with(an_instance_of(Symbol)) do
            "symbol"
          end
          object.stub(:foo).with(an_instance_of(String)) do
            "string"
          end

          object.foo("bar").should eq("string")
          object.foo(:that).should eq("symbol")
        end
      end
      """
    When I run `rspec stub_an_instance_of_args_spec.rb`
    Then the output should contain "1 example, 0 failures"

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-mocks-2.13.0/features/argument_matchers/type_matchers.feature
sshp-0.0.2 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/features/argument_matchers/type_matchers.feature
sshp-0.0.1 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/features/argument_matchers/type_matchers.feature
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/features/argument_matchers/type_matchers.feature
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/features/argument_matchers/type_matchers.feature
rspec-mocks-2.13.1 features/argument_matchers/type_matchers.feature
vagrant-actionio-0.0.9 vendor/bundle/gems/rspec-mocks-2.13.0/features/argument_matchers/type_matchers.feature
rspec-mocks-2.13.0 features/argument_matchers/type_matchers.feature
remq-0.0.4 vendor/bundle/gems/rspec-mocks-2.12.2/features/argument_matchers/type_matchers.feature
remq-0.0.3 vendor/bundle/gems/rspec-mocks-2.12.2/features/argument_matchers/type_matchers.feature
rspec-mocks-2.12.2 features/argument_matchers/type_matchers.feature
rspec-mocks-2.12.1 features/argument_matchers/type_matchers.feature
rspec-mocks-2.12.0 features/argument_matchers/type_matchers.feature