jdan/rubycards — pull request #22 by darrencauthon (2014-07-25 04:14:37+00:00)
Title: Shuffle tests

I added a test to verify that the cards were shuffled using the shuffle method.

I know, I know, some people don't like mocking in tests like this, but I've found that it's the easiest way to test behaviors that are tied to any sort of randomization -- especially when the randomization is done deep in the language or framework.

This production code change demonstrates the problem with **not** using the mock. I changed ```shuffle!``` to delete all of the cards and the tests still passed, as they weren't actually testing that the shuffle was occuring: https://github.com/darrencauthon/rubycards/commit/f265ca4e4cd90d0c38cd89613dd2ad68e8316c05#diff-d145fa3fd23d3dc189ba7fa0ef16a3f8R33