changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
3module Spec
4 module Matchers
5 describe Eql do
6 it "should match when actual.eql?(expected)" do
7 Eql.new(1).matches?(1).should be_true
8 end
9 it "should not match when !actual.eql?(expected)" do
10 Eql.new(1).matches?(2).should be_false
11 end
12 it "should describe itself" do
13 matcher = Eql.new(1)
14 matcher.description.should == "eql 1"
15 end
16 it "should provide message, expected and actual on #failure_message" do
17 matcher = Eql.new("1")
18 matcher.matches?(1)
19 matcher.failure_message.should == ["expected \"1\", got 1 (using .eql?)", "1", 1]
20 end
21 it "should provide message, expected and actual on #negative_failure_message" do
22 matcher = Eql.new(1)
23 matcher.matches?(1)
24 matcher.negative_failure_message.should == ["expected 1 not to equal 1 (using .eql?)", 1, 1]
25 end
26 end
27 end
28end