Sha256: 683332a002b7abf16730238430574d84b61f1d87e3cde2973773151cdf7ba1b3

Contents?: true

Size: 858 Bytes

Versions: 38

Compression:

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

38 entries across 38 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
rspec-mocks-2.99.4 features/argument_matchers/type_matchers.feature
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-mocks-2.14.6/features/argument_matchers/type_matchers.feature
rspec-mocks-2.99.3 features/argument_matchers/type_matchers.feature
rspec-mocks-2.99.2 features/argument_matchers/type_matchers.feature
dxruby_rp5-0.0.4 spec/vendor/rspec-mocks-2.14.4/features/argument_matchers/type_matchers.feature
rspec-mocks-2.99.1 features/argument_matchers/type_matchers.feature
rspec-mocks-2.99.0 features/argument_matchers/type_matchers.feature
rspec-mocks-2.99.0.rc1 features/argument_matchers/type_matchers.feature
rspec-mocks-2.14.6 features/argument_matchers/type_matchers.feature
rspec-mocks-2.99.0.beta2 features/argument_matchers/type_matchers.feature
rspec-mocks-2.14.5 features/argument_matchers/type_matchers.feature
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-mocks-2.14.4/features/argument_matchers/type_matchers.feature