Sha256: c2c75725d808fd204e11f783c09684b25e4545315da394843c9d2da030c87845
Contents?: true
Size: 659 Bytes
Versions: 14
Compression:
Stored size: 659 Bytes
Contents
require File.expand_path('../../spec_helper', __FILE__) describe 'stub!' do it "is a terser way of creating an object and stubbing it" do object = stub!.some_method { 'value' }.subject expect(object.some_method).to eq 'value' end it "can be used inside the implementation block of a double" do object = Object.new stub(object).some_method { stub!.another_method { 'value' } } expect(object.some_method.another_method).to eq 'value' end it "can be called on a double" do object = Object.new stub(object).some_method.stub!.another_method { 'value' } expect(object.some_method.another_method).to eq 'value' end end
Version data entries
14 entries across 14 versions & 1 rubygems