redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

backfill Array#sample so tests pass in ruby 1.8.7 #241

Closed kellyredding closed 9 years ago

kellyredding commented 9 years ago

The test suite was updated to use Array#sample instead of Array#choice in 239 so that the test suite would pass in modern ruby versions. However, I would prefer that the test suite continues to pass in ruby 1.8.7 as well.

This backfills the sample method so that tests will pass in 1.8.7.

See #239 for reference.

@jcredding ready for review. You good with this backfill implementation?

jcredding commented 9 years ago

@kellyredding - As long as assert doesn't use sample anywhere in its lib code I'm good with this :boom:

kellyredding commented 9 years ago

@jcredding good thought - I checked and sample is only used in the test code. Which makes sense given the random nature of sample.