From 12e00f9238bf5164df98551db029a581fd25d54e Mon Sep 17 00:00:00 2001 From: h2so5 Date: Wed, 30 Oct 2013 12:52:26 +0900 Subject: implement Class.new with block --- test/t/class.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/t/class.rb b/test/t/class.rb index 403a95f10..d6c0f1c9a 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -9,7 +9,15 @@ assert('Class superclass', '15.2.3.2') do assert_equal(Module, Class.superclass) end -# Class#initialize '15.2.3.3.1' is tested in Class#new +assert('Class#initialize', '15.2.3.3.1') do + c = Class.new do + def test + :test + end + end.new + + assert_equal(c.test, :test) +end assert('Class#initialize_copy', '15.2.3.3.2') do class TestClass -- cgit v1.2.3