1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
5 context %Q{The Spec::Matchers module gets included in the execution context of every spec.
6 This module should provide the following methods, each of which returns a Matcher object.} do
8 be_true.should be_an_instance_of(Be)
11 be_false.should be_an_instance_of(Be)
14 be_nil.should be_an_instance_of(Be)
16 it "be_arbitrary_predicate" do
17 be_arbitrary_predicate.should be_an_instance_of(Be)
20 be_close(1,2).should be_an_instance_of(BeClose)
23 change("target", :message).should be_an_instance_of(Change)
26 eql(:expected).should be_an_instance_of(Eql)
29 equal(:expected).should be_an_instance_of(Equal)
32 have(0).should be_an_instance_of(Have)
35 have_exactly(0).should be_an_instance_of(Have)
38 have_at_least(0).should be_an_instance_of(Have)
41 have_at_most(0).should be_an_instance_of(Have)
44 include(:value).should be_an_instance_of(Include)
47 match(:value).should be_an_instance_of(Match)
50 raise_error.should be_an_instance_of(RaiseError)
51 raise_error(NoMethodError).should be_an_instance_of(RaiseError)
52 raise_error(NoMethodError, "message").should be_an_instance_of(RaiseError)
55 satisfy{}.should be_an_instance_of(Satisfy)
58 throw_symbol.should be_an_instance_of(ThrowSymbol)
59 throw_symbol(:sym).should be_an_instance_of(ThrowSymbol)
62 respond_to(:sym).should be_an_instance_of(RespondTo)
66 describe "Spec::Matchers#method_missing" do
67 it "should convert be_xyz to Be(:be_xyz)" do
68 Be.should_receive(:new).with(:be_whatever)
72 it "should convert have_xyz to Has(:have_xyz)" do
73 Has.should_receive(:new).with(:have_whatever)