changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
3module 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
23end