summaryrefslogtreecommitdiffhomepage
path: root/test/t
diff options
context:
space:
mode:
authorksss <[email protected]>2016-12-21 18:31:44 +0900
committerksss <[email protected]>2016-12-22 10:40:13 +0900
commita68b568911f5dbf762d26ba21e4171bc7a2473e5 (patch)
treeccfde28ec25c50353593392ce094598d9ea1983b /test/t
parent3cba13c249457cfb318c9d7d4456d99003442139 (diff)
downloadmruby-a68b568911f5dbf762d26ba21e4171bc7a2473e5.tar.gz
mruby-a68b568911f5dbf762d26ba21e4171bc7a2473e5.zip
Should call initialize method if defined
Diffstat (limited to 'test/t')
-rw-r--r--test/t/proc.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/t/proc.rb b/test/t/proc.rb
index 888b7d56a..ef4566e66 100644
--- a/test/t/proc.rb
+++ b/test/t/proc.rb
@@ -136,6 +136,18 @@ assert('Proc#return_does_not_break_self') do
assert_equal c, c.block.call
end
+assert('call Proc#initialize if defined') do
+ a = []
+ c = Class.new(Proc) do
+ define_method(:initialize) do
+ a << :ok
+ end
+ end
+
+ assert_kind_of c, c.new{}
+ assert_equal [:ok], a
+end
+
assert('&obj call to_proc if defined') do
pr = Proc.new{}
def mock(&b)