Sha256: 86c0dc81f63a3b6f6ec615e6297bca04e21cc1036fe3631d2ef4dfd2ce2fd073
Contents?: true
Size: 1 KB
Versions: 1
Compression:
Stored size: 1 KB
Contents
describe "Application 'stump-test'" do class Hello end it "stub on object" do Hello.stub!(:thing, :return => "hey!") Hello.should.not.be.nil Hello.thing.should == "hey!" my_obj = Object.new my_obj.stub!(:hello) my_obj.hello.should.be.nil end it "should create pure stub" do my_stub = stub(:thing, :return => "dude, a thing!") my_stub.thing.should == "dude, a thing!" end it "should mock object" do my_object = "things are fun" my_object.mock!(:fancy, :return => "ooo fancy!") my_object.mock!(:tancy, :return => "ooo tancy!") my_object.fancy.should == 'ooo fancy!' end # it "should create pure mock" do # my_mock = mock(:hello, :return => "what fun is this?") # my_mock.hello.should == "what fun is this?" # end # class Greeting # def bonjour # "Bonjour!" # end # end # it "should use proxy objects" do # greet_me = Greeting.new # greet_me.proxy!(:bonjour) # greet_me.bonjour # => "Bonjour!" # end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
motion-stump-0.1.0 | spec/main_spec.rb |