diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-03 06:30:56 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-03 06:30:56 -0700 |
| commit | 9a0fba7f0decf77cbef49e4277b72e9276399047 (patch) | |
| tree | 9ac3050b05944a0b2e4134c202e39d03dca19596 /test/t/class.rb | |
| parent | 6bd49a3d95c836e82382f333a600a368bf0638fc (diff) | |
| parent | 4bb7243c2b9ad9d5e1e84f519ac676300a85428e (diff) | |
| download | mruby-9a0fba7f0decf77cbef49e4277b72e9276399047.tar.gz mruby-9a0fba7f0decf77cbef49e4277b72e9276399047.zip | |
Merge pull request #1128 from monaka/pr-add-iso-confomance-tests-20130402
Add ISO confomance tests
Diffstat (limited to 'test/t/class.rb')
| -rw-r--r-- | test/t/class.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb index 1c50853dc..72214a2fc 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -9,6 +9,26 @@ assert('Class superclass', '15.2.3.2') do Class.superclass == Module end +# Class#initialize '15.2.3.3.1' is tested in Class#new + +assert('Class#initialize_copy', '15.2.3.3.2') do + class TestClass + attr_accessor :n + def initialize(n) + @n = n + end + def initialize_copy(obj) + @n = n + end + end + + c1 = TestClass.new('Foo') + c2 = c1.dup + c3 = TestClass.new('Bar') + + c1.n == c2.n and c1.n != c3.n +end + assert('Class#new', '15.2.3.3.3') do # at the moment no exception on singleton class #e1 = nil |
