Skip to content

Instantly share code, notes, and snippets.

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 kruszczynski/947dad2b2e07992033b2 to your computer and use it in GitHub Desktop.
Save kruszczynski/947dad2b2e07992033b2 to your computer and use it in GitHub Desktop.
# Model
def method(argument, &block)
SomeLibrary.new.other_method(argument, &block)
end
# Test
should '#method' do
block = -> {}
block = Proc.new {}
lib = mock('Library')
lib.expects(:other_method).with(:arg, block)
SomeLibrary.expects(:new).returns(lib)
@instance.method(:arg, &block)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment