lib/bogus/fakes/method_stringifier.rb in bogus-0.1.6 vs lib/bogus/fakes/method_stringifier.rb in bogus-0.1.7
- old
+ new
@@ -25,15 +25,15 @@
end.join(', ')
end
def argument_to_string(name, type, default)
case type
- when :block then "&#{name}"
+ when :block then "&#{name == :& ? 'block' : name}"
when :key then default ? "#{name}: #{default}" : "#{name}: #{name}"
when :keyreq then default ? "#{name}:" : "#{name}: #{name}"
when :opt then default ? "#{name} = #{default}" : name
when :req then name
- when :rest then "*#{name}"
+ when :rest then "*#{name == :* ? 'rest' : name}"
when :keyrest then "**#{name}"
else raise "unknown argument type: #{type}"
end
end