Skip to content

Instantly share code, notes, and snippets.

@dgreenway
Created September 9, 2014 06:32
Show Gist options
  • Save dgreenway/dcf6da801d03305d5447 to your computer and use it in GitHub Desktop.
Save dgreenway/dcf6da801d03305d5447 to your computer and use it in GitHub Desktop.
Use MiniTest to set up a mock and stub to test that a method has been called.
mock = MiniTest::Mock.new
mock.expect(:call, true)
fa.stub(:the_thing, mock) do
fa.method_that_calls_the_thing
end
assert mock.verify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment