Sha256: 641cb55b33179c1f621ee0ae7962f11f550b34ea8e854eda58295f299d90f505
Contents?: true
Size: 558 Bytes
Versions: 15
Compression:
Stored size: 558 Bytes
Contents
describe "Array#take" do it "returns the first specified number of elements" do [1, 2, 3].take(2).should == [1, 2] end it "returns all elements when the argument is greater than the Array size" do [1, 2].take(99).should == [1, 2] end it "returns all elements when the argument is less than the Array size" do [1, 2].take(4).should == [1, 2] end it "returns an empty Array when passed zero" do [1].take(0).should == [] end it "returns an empty Array when called on an empty Array" do [].take(3).should == [] end end
Version data entries
15 entries across 15 versions & 1 rubygems