Created
May 14, 2016 01:59
-
-
Save phlcastro/41edf06a5439c906dc5460a01afd744e to your computer and use it in GitHub Desktop.
How to deal with random values on RSpec
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
allow(YourClass).to receive(:your_method).with('your parameter').and_return('your result') | |
#ie.: | |
allow(Random).to receive(:rand).with(1..9).and_return(7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment