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: 7e5c87e75930
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 84120758c58f
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Mar 4, 2015

  1. Copy the full SHA
    60ef388 View commit details
  2. Copy the full SHA
    6a7edcd View commit details
  3. Merge pull request #3340 from jsyeo/min-optional-arg-spec

    Add specs for Enumerable#min with optional arg. 🐒
    Yorick Peterse committed Mar 4, 2015
    Copy the full SHA
    8412075 View commit details
Showing with 17 additions and 2 deletions.
  1. +15 −2 spec/ruby/core/enumerable/min_spec.rb
  2. +2 −0 spec/tags/ruby/core/enumerable/min_tags.txt
17 changes: 15 additions & 2 deletions spec/ruby/core/enumerable/min_spec.rb
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@

describe "Enumerable#min" do
before :each do
@a = EnumerableSpecs::EachDefiner.new( 2, 4, 6, 8, 10 )

@e_strs = EnumerableSpecs::EachDefiner.new("333", "22", "666666", "1", "55555", "1010101010")
@e_ints = EnumerableSpecs::EachDefiner.new( 333, 22, 666666, 55555, 1010101010)
end
@@ -88,4 +86,19 @@
multi.min.should == [1, 2]
end

context "when called with an argument n" do
context "without a block" do
it "returns an array containing the minimum n elements" do
result = @e_ints.min(2)
result.should == [22, 333]
end
end

context "with a block" do
it "returns an array containing the minimum n elements" do
result = @e_ints.min(2) { |a, b| a * 2 <=> b * 2 }
result.should == [22, 333]
end
end
end
end
2 changes: 2 additions & 0 deletions spec/tags/ruby/core/enumerable/min_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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