Permalink
Browse files

DRY up the proc extension.

  • Loading branch information...
1 parent f73737c commit f97bf75eb3784a4580760aa599adbbb960b06564 @tmak tmak committed Nov 12, 2008
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/cucumber/core_ext/proc.rb
@@ -10,10 +10,9 @@ module CallIn
def call_in(obj, *args)
obj.extend(mod)
- a = arity == -1 ? 0 : arity
- if self != StepMother::PENDING && args.length != a
+ if self != StepMother::PENDING && args.length != arity2
# We have to manually raise when the block has arity -1 (no pipes)
- raise ArityMismatchError.new("expected #{arity == -1 ? 0 : arity} block argument(s), got #{args.length}")
+ raise ArityMismatchError.new("expected #{arity2} block argument(s), got #{args.length}")
else
obj.__send__(meth, *args)
end

0 comments on commit f97bf75

Please sign in to comment.