Sha256: 0aad74996b154ae4108d30d29599f6e002360e2ece44bd161797c1ee70dfb212

Contents?: true

Size: 958 Bytes

Versions: 11

Compression:

Stored size: 958 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 = 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 "should 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

11 entries across 11 versions & 1 rubygems

Version Path
rspec-mocks-2.0.0.beta.19 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.18 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.17 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.16 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.15 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.14 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.13 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.12 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.11 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.10 spec/rspec/mocks/argument_expectation_spec.rb
rspec-mocks-2.0.0.beta.9 spec/rspec/mocks/argument_expectation_spec.rb