diff options
| author | h2so5 <[email protected]> | 2013-10-30 12:52:26 +0900 |
|---|---|---|
| committer | h2so5 <[email protected]> | 2013-10-30 12:52:26 +0900 |
| commit | 12e00f9238bf5164df98551db029a581fd25d54e (patch) | |
| tree | bffef2ea906bd9f8adc3285eda155946ba6c3f83 /test | |
| parent | 88758e36308492c860808ed9f7fb66e74f89e589 (diff) | |
| download | mruby-12e00f9238bf5164df98551db029a581fd25d54e.tar.gz mruby-12e00f9238bf5164df98551db029a581fd25d54e.zip | |
implement Class.new with block
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/class.rb | 10 |
1 files changed, 9 insertions, 1 deletions
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 |
