mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@aaf998f
This commit is contained in:
parent
ae650f0372
commit
8db4f25bf4
41 changed files with 821 additions and 56 deletions
|
@ -19,10 +19,18 @@ describe "Array#sample" do
|
|||
[].sample.should be_nil
|
||||
end
|
||||
|
||||
it "returns nil for an empty array when called without n and a Random is given" do
|
||||
[].sample(random: Random.new(42)).should be_nil
|
||||
end
|
||||
|
||||
it "returns a single value when not passed a count" do
|
||||
[4].sample.should equal(4)
|
||||
end
|
||||
|
||||
it "returns a single value when not passed a count and a Random is given" do
|
||||
[4].sample(random: Random.new(42)).should equal(4)
|
||||
end
|
||||
|
||||
it "returns an empty Array when passed zero" do
|
||||
[4].sample(0).should == []
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue