Sha256: e6225d8b8ae4ff17a8653ff7079637e1d3a83d26ef6ccead1d4f78fa24ea52d5

Contents?: true

Size: 951 Bytes

Versions: 32

Compression:

Stored size: 951 Bytes

Contents

require 'spec_helper'

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

32 entries across 32 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 spec/spec/mocks/argument_expectation_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/spec/spec/mocks/argument_expectation_spec.rb
rspec-1.3.2 spec/spec/mocks/argument_expectation_spec.rb
rspec-1.3.1 spec/spec/mocks/argument_expectation_spec.rb
rspec-1.3.1.rc spec/spec/mocks/argument_expectation_spec.rb
rspec-1.3.0 spec/spec/mocks/argument_expectation_spec.rb
hubbub-0.0.11 lib/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb
hubbub-0.0.10 lib/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb
hubbub-0.0.9 lib/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb
hubbub-0.0.8 lib/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb
hubbub-0.0.6 lib/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/spec/spec/mocks/argument_expectation_spec.rb
media-path-0.1.2 vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb
simple-templater-0.0.1.3 vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb
pupu-0.0.2.pre vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb
media-path-0.1.1.pre vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb
simple-templater-0.0.1.2 vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb
media-path-0.1.1 vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb
simple-templater-0.0.1.1 vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb
pupu-0.0.2 vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb