Sha256: ab039ec17d140ca29bd238790d3927f78e91dcdc0bcebb1bfdf031b1125384cd

Contents?: true

Size: 993 Bytes

Versions: 4

Compression:

Stored size: 993 Bytes

Contents

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

module Spec
  module Matchers
    describe "eql" do
      it "should match when actual.eql?(expected)" do
        eql(1).matches?(1).should be_true
      end
      it "should not match when !actual.eql?(expected)" do
        eql(1).matches?(2).should be_false
      end
      it "should describe itself" do
        matcher = eql(1)
        matcher.matches?(1)
        matcher.description.should == "eql 1"
      end
      it "should provide message, expected and actual on #failure_message" do
        matcher = eql("1")
        matcher.matches?(1)
        matcher.failure_message_for_should.should == ["expected \"1\", got 1 (using .eql?)", "1", 1]
      end
      it "should provide message, expected and actual on #negative_failure_message" do
        matcher = eql(1)
        matcher.matches?(1)
        matcher.failure_message_for_should_not.should == ["expected 1 not to equal 1 (using .eql?)", 1, 1]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
dchelimsky-rspec-1.1.99.13 spec/spec/matchers/eql_spec.rb
rspec-1.2.0 spec/spec/matchers/eql_spec.rb
rspec-1.2.1 spec/spec/matchers/eql_spec.rb
rspec-1.2.2 spec/spec/matchers/eql_spec.rb