Sha256: 9946e83168877da417b64e6d4c5bee27bcf19ca4b7dffa2278a2b6cf63244cd6

Contents?: true

Size: 971 Bytes

Versions: 11

Compression:

Stored size: 971 Bytes

Contents

require 'spec_helper'

module RSpec
  module Matchers
    describe "eql" do
      it "should match when actual.eql?(expected)" do
        1.should eql(1)
      end
      
      it "should not match when !actual.eql?(expected)" do
        1.should_not eql(2)
      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 == "\nexpected \"1\"\n     got 1\n\n(compared using eql?)\n"
      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 == "\nexpected 1 not to equal 1\n\n(compared using eql?)\n"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rspec-expectations-2.0.0.beta.19 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.18 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.17 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.16 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.15 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.14 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.13 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.12 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.11 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.10 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.0.0.beta.9 spec/rspec/matchers/eql_spec.rb