Sha256: 100b2eb43dd6900ec9fbc65934b137a0e2ccf1f2bf487980a3486f4894b63caa
Contents?: true
Size: 728 Bytes
Versions: 16
Compression:
Stored size: 728 Bytes
Contents
require 'spec_helper' module Rspec module Mocks describe "stub implementation" do describe "with no args" do it "execs the block when called" do obj = stub() obj.stub(:foo) { :bar } obj.foo.should == :bar end end describe "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 describe "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
16 entries across 16 versions & 1 rubygems