Sha256: 24df73f88aaff5a6b511e0ece93ca941d302ce089b71a90c1238b5d92dd11455

Contents?: true

Size: 1001 Bytes

Versions: 11

Compression:

Stored size: 1001 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 == "eq 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

11 entries across 11 versions & 3 rubygems

Version Path
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.7.0 spec/rspec/matchers/eq_spec.rb
rspec-expectations-2.7.0.rc1 spec/rspec/matchers/eq_spec.rb