changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/matchers/simple_matcher_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'
2
3module 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
31end