Sha256: d7ce4ab145d7c5794beaa94b7642ddb00dfaef5e877f3bc87ecfc8f682f2111f
Contents?: true
Size: 954 Bytes
Versions: 12
Compression:
Stored size: 954 Bytes
Contents
require 'spec_helper' module Rspec module Mocks describe ArgumentExpectation do it "should consider an object that responds to #matches? and #description to be a matcher" do argument_expecatation = Rspec::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 = Rspec::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 end end
Version data entries
12 entries across 12 versions & 1 rubygems