Sha256: 5d4caa6656c8058d06ce8e42368a37bb397aafeb4ab7581922006cea852be82c

Contents?: true

Size: 986 Bytes

Versions: 98

Compression:

Stored size: 986 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

module Spec
  module Mocks
    describe 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
  end
end

Version data entries

98 entries across 98 versions & 13 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.11.1 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.11.5 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.11.6 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.11.7 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.12 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.1 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.13 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.2 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.3 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.4 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.5 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.6 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.7 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.8 spec/spec/mocks/argument_expectation_spec.rb
dchelimsky-rspec-1.1.99.9 spec/spec/mocks/argument_expectation_spec.rb