Sha256: 227dbfa58de656dc2a1ce7856fae6d2ba7d6ddcde23cb3a58ac46d8583c8f1f6

Contents?: true

Size: 946 Bytes

Versions: 1

Compression:

Stored size: 946 Bytes

Contents

require 'spec_helper'

module RSpec
  module Matchers
    describe "eql" do
      it "matches when actual.eql?(expected)" do
        1.should eql(1)
      end
      
      it "does not match when !actual.eql?(expected)" do
        1.should_not eql(2)
      end
      
      it "describes itself" do
        matcher = eql(1)
        matcher.matches?(1)
        matcher.description.should == "eql 1"
      end
      
      it "provides 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 "provides 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

1 entries across 1 versions & 1 rubygems

Version Path
rspec-expectations-2.0.0.beta.20 spec/rspec/matchers/eql_spec.rb