Sha256: 56850e246090286c2e9fc90c10fb05362b6d3a9126b485ad5b58364e2be1229d

Contents?: true

Size: 890 Bytes

Versions: 14

Compression:

Stored size: 890 Bytes

Contents

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

describe "An 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

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb
rspec-0.9.1 spec/spec/mocks/argument_expectation_spec.rb
rspec-0.9.2 spec/spec/mocks/argument_expectation_spec.rb
rspec-0.9.3 spec/spec/mocks/argument_expectation_spec.rb
rspec-1.0.0 spec/spec/mocks/argument_expectation_spec.rb
rspec-1.0.1 spec/spec/mocks/argument_expectation_spec.rb
rspec-1.0.2 spec/spec/mocks/argument_expectation_spec.rb
rspec-1.0.3 spec/spec/mocks/argument_expectation_spec.rb
rspec-1.0.4 spec/spec/mocks/argument_expectation_spec.rb
rspec-1.0.5 spec/spec/mocks/argument_expectation_spec.rb
rspec-0.9.4 spec/spec/mocks/argument_expectation_spec.rb
rspec-0.9.0 spec/spec/mocks/argument_expectation_spec.rb