Skip to content
This repository
Browse code

Clarifies preconditions for the Array#sample(n) to return source array

  • Loading branch information...
commit 9fe3b570cbbeaec8dc398d8c54827a3107d5ed20 1 parent 43f63a9
Ben Cullen-Kerney bak authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  core/array/sample_spec.rb
2  core/array/sample_spec.rb
@@ -38,7 +38,7 @@
38 38 a.sample(obj).size.should == 2
39 39 end
40 40
41   - it "returns all values with n big enough" do
  41 + it "returns all values when n >= array size" do
42 42 a = [1, 2, 3, 4]
43 43 a.sample(4).sort.should == a
44 44 a.sample(5).sort.should == a

0 comments on commit 9fe3b57

Please sign in to comment.
Something went wrong with that request. Please try again.