Sha256: 0aad74996b154ae4108d30d29599f6e002360e2ece44bd161797c1ee70dfb212
Contents?: true
Size: 958 Bytes
Versions: 11
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
11 entries across 11 versions & 1 rubygems