Created
September 9, 2014 06:32
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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