Sha256: f4e91c5cc1035a1a23687a10dd510bd00a835c9d3e24d447bfc1c41607ddf6fc

Contents?: true

Size: 992 Bytes

Versions: 77

Compression:

Stored size: 992 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

module Spec
  module Matchers
    describe Equal do
      it "should match when actual.equal?(expected)" do
        Equal.new(1).matches?(1).should be_true
      end
      it "should not match when !actual.equal?(expected)" do
        Equal.new("1").matches?("1").should be_false
      end
      it "should describe itself" do
        matcher = Equal.new(1)
        matcher.description.should == "equal 1"
      end
      it "should provide message, expected and actual on #failure_message" do
        matcher = Equal.new("1")
        matcher.matches?(1)
        matcher.failure_message.should == ["expected \"1\", got 1 (using .equal?)", "1", 1]
      end
      it "should provide message, expected and actual on #negative_failure_message" do
        matcher = Equal.new(1)
        matcher.matches?(1)
        matcher.negative_failure_message.should == ["expected 1 not to equal 1 (using .equal?)", 1, 1]
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 12 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/matchers/equal_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/matchers/equal_spec.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/matchers/equal_spec.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/matchers/equal_spec.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/matchers/equal_spec.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/matchers/equal_spec.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/matchers/equal_spec.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/matchers/equal_spec.rb
deckshuffler-0.0.2 vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
mack-0.8.2 lib/gems/rspec-1.1.11/spec/spec/matchers/equal_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/matchers/equal_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/matchers/equal_spec.rb