Sha256: 647f452b8e202ce3b47e32fff35f31228b8b8d6bad9e5c3a1e2df119bf4cb5c0
Contents?: true
Size: 724 Bytes
Versions: 32
Compression:
Stored size: 724 Bytes
Contents
require 'spec_helper' module Spec module Mocks describe "stub implementation" do context "with no args" do it "execs the block when called" do obj = stub() obj.stub(:foo) { :bar } obj.foo.should == :bar end end context "with one arg" do it "execs the block with that arg when called" do obj = stub() obj.stub(:foo) {|given| given} obj.foo(:bar).should == :bar end end context "with variable args" do it "execs the block when called" do obj = stub() obj.stub(:foo) {|*given| given.first} obj.foo(:bar).should == :bar end end end end end
Version data entries
32 entries across 32 versions & 11 rubygems