Skip to content

Instantly share code, notes, and snippets.

@djo
Created October 1, 2011 21:42
Show Gist options
  • Save djo/1256688 to your computer and use it in GitHub Desktop.
Save djo/1256688 to your computer and use it in GitHub Desktop.
Pseudorandom number generator stub
words = ['qwerty', 'abcdef', 'xyzzyx']
SecureRandom.stub(:base64) { words.shift }
SecureRandom.base64.should eq('qwerty')
SecureRandom.base64.should eq('abcdef')
SecureRandom.base64.should eq('xyzzyx')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment