Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e8e4e5f8e1
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (31 sloc) 1.009 kb
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: value != 1\n got: 1\n\n(compared using ==)\n"
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.