summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-03 08:23:40 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-03 08:23:40 +0900
commit7f243a9b53bddda79c424a0982576d1a9bb79677 (patch)
treeab724f498509861496863bbd5932d5565e9d4e4e /test
parentdf80b7835a5d99e2f5a25446abb53ea3e68e7709 (diff)
parent8583b622771fa32d0d086bfc5e3b4952bfc14be1 (diff)
downloadmruby-7f243a9b53bddda79c424a0982576d1a9bb79677.tar.gz
mruby-7f243a9b53bddda79c424a0982576d1a9bb79677.zip
resolve conflict in test/t/class.rb
Diffstat (limited to 'test')
-rw-r--r--test/t/class.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb
index cb056feff..d252cf590 100644
--- a/test/t/class.rb
+++ b/test/t/class.rb
@@ -10,6 +10,36 @@ assert('Class#superclass', '15.2.3.3.4') do
SubClass.superclass == String
end
+assert('Class#new', '15.2.3.3.3') do
+ # at the moment no exception on singleton class
+ #e1 = nil
+ #begin
+ # class1 = e1.singleton_class.new
+ #rescue => e1
+ # e2 = e1
+ #end
+
+ class TestClass
+ def initialize args, &block
+ @result = if not args.nil? and block.nil?
+ # only arguments
+ :only_args
+ elsif not args.nil? and not block.nil?
+ # args and block is given
+ :args_and_block
+ else
+ # this should never happen
+ :broken
+ end
+ end
+
+ def result; @result; end
+ end
+
+ TestClass.new(:arg).result == :only_args
+ # with block doesn't work yet
+end
+
# Not ISO specified
assert('Class 1') do