Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 84120758c58f
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ed98c0538edf
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Mar 4, 2015

  1. Copy the full SHA
    a50bb72 View commit details
  2. Merge pull request #3341 from jsyeo/min-optional-arg-spec

    Specify some edge cases for Enumerable#min optional arg
    Yorick Peterse committed Mar 4, 2015
    Copy the full SHA
    ed98c05 View commit details
Showing with 14 additions and 0 deletions.
  1. +13 −0 spec/ruby/core/enumerable/min_spec.rb
  2. +1 −0 spec/tags/ruby/core/enumerable/min_tags.txt
13 changes: 13 additions & 0 deletions spec/ruby/core/enumerable/min_spec.rb
Original file line number Diff line number Diff line change
@@ -100,5 +100,18 @@
result.should == [22, 333]
end
end

context "on a enumerable of length x where x < n" do
it "returns an array containing the minimum n elements of length x" do
result = @e_ints.min(500)
result.length.should == 5
end
end

context "that is negative" do
it "raises an Argument error" do
lambda { @e_ints.min(-1) }.should raise_error(ArgumentError)
end
end
end
end
1 change: 1 addition & 0 deletions spec/tags/ruby/core/enumerable/min_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
fails:Enumerable#min when called with an argument n without a block returns an array containing the minimum n elements
fails:Enumerable#min when called with an argument n with a block returns an array containing the minimum n elements
fails:Enumerable#min when called with an argument n on a enumerable of length x where x < n returns an array containing the minimum n elements of length x