Add test for Proc#parameters

This commit is contained in:
Tatsuhiko Kubo
2014-07-13 01:27:28 +09:00
committed by Yukihiro "Matz" Matsumoto
parent cc71bd51f1
commit d2fb4752e2
+5
View File
@@ -13,6 +13,11 @@ assert('Proc#inspect') do
assert_kind_of String, ins
end
assert('Proc#parameters') do
parameters = Proc.new{|x,y=42,*other|}.parameters
assert_equal [[:opt, :x], [:opt, :y], [:rest, :other]], parameters
end
assert('Proc#lambda?') do
assert_true lambda{}.lambda?
assert_true !Proc.new{}.lambda?