]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/spec/spec/mocks/argument_expectation_spec.rb
Show whether a trace is public or private in the trace list, so that a user can easil...
[rails.git] / vendor / gems / rspec-1.1.2 / spec / spec / mocks / argument_expectation_spec.rb
1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
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
13
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