Skip to content

Commit

Permalink
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion spec/ruby/core/array/max_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Array#max" do
it "returns nil with no values" do
[].max.should == nil
end

it "returns only element in one element array" do
[1].max.should == 1
end

it "returns largest value with multiple elements" do
[1,2].max.should == 2
[2,1].max.should == 2
end

describe "given a block with one argument" do
it "yields in turn the last length-1 values from the array" do
ary = []
@@ -10,4 +23,4 @@
result.should == 5
end
end
end
end

0 comments on commit 1e8c65a

Please sign in to comment.