adding all of botlist, initial add
[botlist.git] / openbotlist / WEB-INF / lib / ruby / rspec / spec / spec / matchers / simple_matcher_spec.rb
blobb731af92d993660eed314a38568dc27f043f5f0c
1 require File.dirname(__FILE__) + '/../../spec_helper'
3 module Spec
4   module Matchers
5     describe SimpleMatcher do
6       it "should match pass match arg to block" do
7         actual = nil
8         matcher = simple_matcher("message") do |given| actual = given end
9         matcher.matches?("foo")
10         actual.should == "foo"
11       end
12       
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\"/
17       end
18       
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\"/
23       end
24       
25       it "should provide a description" do
26         matcher = simple_matcher("thing") do end
27         matcher.description.should =="thing"
28       end
29     end
30   end
31 end