Sha256: 9cfb065f5a6262eabf5d4215e1685bb38bdad9a9ef1410b4d6d5b53e4a797cf1

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

module RSpec
  module Matchers
    describe "eql" do
      it_behaves_like "an RSpec matcher", :valid_value => 1, :invalid_value => 2 do
        let(:matcher) { eql(1) }
      end

      it "is diffable" do
        eql(1).should be_diffable
      end

      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: value != 1\n     got: 1\n\n(compared using eql?)\n"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 5 rubygems

Version Path
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.11.3/spec/rspec/matchers/eql_spec.rb
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.11.3/spec/rspec/matchers/eql_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/rspec-expectations-2.12.1/spec/rspec/matchers/eql_spec.rb
remq-0.0.4 vendor/bundle/gems/rspec-expectations-2.12.1/spec/rspec/matchers/eql_spec.rb
remq-0.0.3 vendor/bundle/gems/rspec-expectations-2.12.1/spec/rspec/matchers/eql_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/rspec-expectations-2.12.1/spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.12.1 spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.12.0 spec/rspec/matchers/eql_spec.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.11.3/spec/rspec/matchers/eql_spec.rb
rspec-expectations-2.11.3 spec/rspec/matchers/eql_spec.rb