Sha256: 794ff2e8c7907a4bc6e654623283b11e60d761a791476f9f4fc9d211e63035b7

Contents?: true

Size: 976 Bytes

Versions: 25

Compression:

Stored size: 976 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.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.negative_failure_message.should == ["expected 1 not to equal 1 (using .eql?)", 1, 1]
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 5 rubygems

Version Path
spree-0.6.0 vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb
spree-0.7.0 vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb
spree-0.7.1 vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb
spree-0.8.0 vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb
spree-0.8.1 vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb