Sha256: fc67407a3d640e826049e09db157649c437851fddaa320fa8fa144aeb1523988

Contents?: true

Size: 999 Bytes

Versions: 33

Compression:

Stored size: 999 Bytes

Contents

require 'spec_helper'

module RSpec
  module Matchers
    describe "eq" do
      it "is diffable" do
        eq(1).should be_diffable
      end

      it "matches when actual == expected" do
        1.should eq(1)
      end
      
      it "does not match when actual != expected" do
        1.should_not eq(2)
      end
      
      it "describes itself" do
        matcher = eq(1)
        matcher.matches?(1)
        matcher.description.should == "== 1"
      end
      
      it "provides message, expected and actual on #failure_message" do
        matcher = eq("1")
        matcher.matches?(1)
        matcher.failure_message_for_should.should == "\nexpected \"1\"\n     got 1\n\n(compared using ==)\n"
      end
      
      it "provides message, expected and actual on #negative_failure_message" do
        matcher = eq(1)
        matcher.matches?(1)
        matcher.failure_message_for_should_not.should == "\nexpected 1 not to equal 1\n\n(compared using ==)\n"
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rspec-expectations-2.5.0/spec/rspec/matchers/eq_spec.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rspec-expectations-2.5.0/spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.6.0 spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.6.0.rc6 spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.6.0.rc4 spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.6.0.rc2 spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.5.0 spec/rspec/matchers/eq_spec.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.4.0 spec/rspec/matchers/eq_spec.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eq_spec.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eq_spec.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.3.0 spec/rspec/matchers/eq_spec.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eq_spec.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eq_spec.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.2.0 spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.1.0 spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.0.1 spec/rspec/matchers/eq_spec.rb
gemrage-1.0.0 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/spec/rspec/matchers/eq_spec.rb