Sha256: 56850e246090286c2e9fc90c10fb05362b6d3a9126b485ad5b58364e2be1229d
Contents?: true
Size: 890 Bytes
Versions: 14
Compression:
Stored size: 890 Bytes
Contents
require File.dirname(__FILE__) + '/../../spec_helper.rb' describe "An ArgumentExpectation" do it "should consider an object that responds to #matches? and #description to be a matcher" do argument_expecatation = Spec::Mocks::ArgumentExpectation.new([]) obj = mock("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 = Spec::Mocks::ArgumentExpectation.new([]) obj = mock("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
Version data entries
14 entries across 14 versions & 2 rubygems