1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
5 describe ArgumentExpectation do
6 it "should consider an object that responds to #matches? and #description to be a matcher" do
7 argument_expecatation = Spec::Mocks::ArgumentExpectation.new([])
9 obj.should_receive(:respond_to?).with(:matches?).and_return(true)
10 obj.should_receive(:respond_to?).with(:description).and_return(true)
11 argument_expecatation.is_matcher?(obj).should be_true
14 it "should NOT consider an object that only responds to #matches? to be a matcher" do
15 argument_expecatation = Spec::Mocks::ArgumentExpectation.new([])
17 obj.should_receive(:respond_to?).with(:matches?).and_return(true)
18 obj.should_receive(:respond_to?).with(:description).and_return(false)
19 argument_expecatation.is_matcher?(obj).should be_false