1 require File.dirname(__FILE__) + '/../../spec_helper'
5 describe SimpleMatcher do
6 it "should match pass match arg to block" do
8 matcher = simple_matcher("message") do |given| actual = given end
9 matcher.matches?("foo")
10 actual.should == "foo"
13 it "should provide a stock failure message" do
14 matcher = simple_matcher("thing") do end
15 matcher.matches?("other")
16 matcher.failure_message.should =~ /expected \"thing\" but got \"other\"/
19 it "should provide a stock negative failure message" do
20 matcher = simple_matcher("thing") do end
21 matcher.matches?("other")
22 matcher.negative_failure_message.should =~ /expected not to get \"thing\", but got \"other\"/
25 it "should provide a description" do
26 matcher = simple_matcher("thing") do end
27 matcher.description.should =="thing"