adding all of botlist, initial add
[botlist.git] / openbotlist / WEB-INF / lib / ruby / rspec / spec / spec / mocks / argument_expectation_spec.rb
blob2bebbdd4fc4d4177dbea543cdc11bab4a00a7257
1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
3 module Spec
4   module Mocks
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([])
8         obj = mock("matcher")
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
12       end
14       it "should NOT consider an object that only responds to #matches? to be a matcher" do
15         argument_expecatation = Spec::Mocks::ArgumentExpectation.new([])
16         obj = mock("matcher")
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
20       end
21     end
22   end
23 end