Sha256: 070ae8516f4a2b539cb290e247c769639ff5b5bb5a1c562bc4cc9ba0819c3f5d
Contents?: true
Size: 642 Bytes
Versions: 20
Compression:
Stored size: 642 Bytes
Contents
require 'spec_helper' describe RSpecCandy::Helpers::StubExisting do describe Object do describe '#stub_existing' do it 'should stub an existing method' do string = 'foo' string.stub_existing(:upcase => 'BAR', :downcase => 'bar') string.upcase.should == 'BAR' string.downcase.should == 'bar' end it 'should raise an error when attempting to stub a non-existing method' do string = 'foo' expect do string.stub_existing(:unknown => 'value') end.to raise_error('Attempted to stub non-existing method #unknown on "foo"') end end end end
Version data entries
20 entries across 20 versions & 1 rubygems