Skip to content

Instantly share code, notes, and snippets.

@queirozfcom
Created July 8, 2014 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save queirozfcom/19beb0ee49c469cd8837 to your computer and use it in GitHub Desktop.
Save queirozfcom/19beb0ee49c469cd8837 to your computer and use it in GitHub Desktop.
Take an already instantiated obj and make it a null_object for the duration of a single test
describe '#put_resource!' do
before(:each) do
@c = Converter.new name: 'c'
@edge_in = double(from: double(), to: @c)
@edge_out = double(from: @c, to: double())
@c.attach_edge!(@edge_out).attach_edge!(@edge_in)
end
it 'does not ping incoming edges' do
expect(@edge_in).not_to receive(:test_ping?)
@edge_out.as_null_object
@c.put_resource!(double())
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment