Sha256: d7ce4ab145d7c5794beaa94b7642ddb00dfaef5e877f3bc87ecfc8f682f2111f

Contents?: true

Size: 954 Bytes

Versions: 12

Compression:

Stored size: 954 Bytes

Contents

require 'spec_helper'

module Rspec
  module Mocks
    describe ArgumentExpectation do
      it "should consider an object that responds to #matches? and #description to be a matcher" do
        argument_expecatation = Rspec::Mocks::ArgumentExpectation.new([])
        obj = mock("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 "should NOT consider an object that only responds to #matches? to be a matcher" do
        argument_expecatation = Rspec::Mocks::ArgumentExpectation.new([])
        obj = mock("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

12 entries across 12 versions & 1 rubygems

Version Path
rspec-mocks-2.0.0.beta.4 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.3 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.2 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.1 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.a10 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.a9 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.a8 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.a7 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.a6 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.a5 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.a4 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.a3 spec/rspec/mocks/argument_expectation_spec.rb