Sha256: 64fa3de4196fcb4b910a67f3d7e920a44886cd500c64b9643b71b9acf8c93ea0

Contents?: true

Size: 850 Bytes

Versions: 145

Compression:

Stored size: 850 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:
      """
      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

145 entries across 91 versions & 12 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.7.5 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.6.9 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.6.9 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
classiccms-0.6.8 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
classiccms-0.6.8 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.6.7 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature
classiccms-0.6.7 vendor/bundle/gems/rspec-mocks-2.9.0/features/argument_matchers/type_matchers.feature
classiccms-0.6.6 vendor/bundle/gems/rspec-mocks-2.10.1/features/argument_matchers/type_matchers.feature