Sha256: 313656cbbcaa78fde64979c1d561d18399c71eabbc5595b63d5131caa363ed8c

Contents?: true

Size: 942 Bytes

Versions: 24

Compression:

Stored size: 942 Bytes

Contents

require 'spec_helper'

module RSpec
  module Mocks
    describe ArgumentExpectation do
      it "considers an object that responds to #matches? and #description to be a matcher" do
        argument_expecatation = RSpec::Mocks::ArgumentExpectation.new
        obj = double("matcher")
        obj.should_receive(:respond_to?).with(:matches?).and_return(true)
        obj.should_receive(:respond_to?).with(:description).and_return(true)
        argument_expecatation.is_matcher?(obj).should be_true
      end

      it "does NOT consider an object that only responds to #matches? to be a matcher" do
        argument_expecatation = RSpec::Mocks::ArgumentExpectation.new
        obj = double("matcher")
        obj.should_receive(:respond_to?).with(:matches?).and_return(true)
        obj.should_receive(:respond_to?).with(:description).and_return(false)
        argument_expecatation.is_matcher?(obj).should be_false
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/argument_expectation_spec.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/argument_expectation_spec.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/argument_expectation_spec.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/argument_expectation_spec.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/argument_expectation_spec.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/argument_expectation_spec.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.1.0 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.1 spec/rspec/mocks/argument_expectation_spec.rb
gemrage-1.0.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.4.1 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.4.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.3.2 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.3.1 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.3.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.2.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.1.2 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.1.1 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.1.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb
gemrage-0.0.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/spec/rspec/mocks/argument_expectation_spec.rb