Sha256: 353e96161fa4fad670589123a547ed3df19bfb5e23097d7443ce8754d2a46640
Contents?: true
Size: 958 Bytes
Versions: 4
Compression:
Stored size: 958 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 = double("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 = double("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
4 entries across 4 versions & 1 rubygems