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

Commits on Mar 14, 2015

  1. Copy the full SHA
    0cee103 View commit details

Commits on Mar 15, 2015

  1. Copy the full SHA
    3a13760 View commit details
Showing with 2 additions and 1 deletion.
  1. +1 −1 kernel/common/proc.rb
  2. +1 −0 spec/ruby/core/proc/curry_spec.rb
2 changes: 1 addition & 1 deletion kernel/common/proc.rb
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ def arity

def curry(curried_arity = nil)
if lambda? && curried_arity
if arity > 0 && curried_arity != arity
if arity >= 0 && curried_arity != arity
raise ArgumentError, "Wrong number of arguments (%i for %i)" % [
curried_arity,
arity
1 change: 1 addition & 0 deletions spec/ruby/core/proc/curry_spec.rb
Original file line number Diff line number Diff line change
@@ -113,6 +113,7 @@

it "raises an ArgumentError if called on a lambda that requires fewer than _arity_ arguments" do
lambda { @lambda_add.curry(4) }.should raise_error(ArgumentError)
lambda { lambda { true }.curry(1) }.should raise_error(ArgumentError)
end

it "calls the curried proc with the arguments if _arity_ arguments have been given" do