Created
December 8, 2015 19:57
-
-
Save pololee/e87d81efed8c9f0231f0 to your computer and use it in GitHub Desktop.
mock yield
This file contains hidden or 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
object = mock() | |
object.expects(:expected_method).yields('result') | |
yielded_value = nil | |
object.expected_method { |value| yielded_value = value } | |
yielded_value # => 'result' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment