Array#repeated_permutation should have arity 1 #1335

Merged
merged 1 commit into from Dec 13, 2013
Jump to file or symbol
Failed to load files and symbols.
+7 −5
Diff settings

Always

Just for now

@@ -3708,11 +3708,6 @@ public IRubyObject repeated_permutation(ThreadContext context, IRubyObject num,
return block.isGiven() ? permutationCommon(context, RubyNumeric.num2int(num), true, block) : enumeratorize(context.runtime, this, "repeated_permutation", num);
}
- @JRubyMethod(name = "repeated_permutation", compat = RUBY1_9)
- public IRubyObject repeated_permutation(ThreadContext context, Block block) {
- return block.isGiven() ? permutationCommon(context, realLength, true, block) : enumeratorize(context.runtime, this, "repeated_permutation");
- }
-
private IRubyObject permutationCommon(ThreadContext context, int r, boolean repeat, Block block) {
if (r == 0) {
block.yield(context, newEmptyArray(context.runtime));
@@ -0,0 +1,7 @@
+require 'rspec'
+
+describe "Array#repeated_permutation" do
+ it "has arity one" do
+ [].method(:repeated_permutation).arity.should == 1
+ end
+end if RUBY_VERSION >= "1.9"