1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
3 describe "ExecutionContext" do
5 it "should provide duck_type()" do
6 dt = duck_type(:length)
7 dt.should be_an_instance_of(Spec::Mocks::DuckTypeArgConstraint)
8 dt.matches?([]).should be_true
11 it "should violate when violated()" do
14 end.should raise_error(Spec::Expectations::ExpectationNotMetError)
17 it "should provide mock()" do
18 mock("thing").should be_an_instance_of(Spec::Mocks::Mock)
21 it "should provide stub()" do
22 thing_stub = stub("thing").should be_an_instance_of(Spec::Mocks::Mock)
25 it "should add method stubs to stub()" do
26 thing_stub = stub("thing", :a => "A", :b => "B")
27 thing_stub.a.should == "A"
28 thing_stub.b.should == "B"