Commit 67c5d554 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2291 from carsonmcdonald/removeivtest

Add test for remove_instance_variable
parents ef01692c aa2e03cd
......@@ -437,6 +437,26 @@ assert('Kernel#raise', '15.3.1.3.40') do
end
end
assert('Kernel#remove_instance_variable', '15.3.1.3.41') do
class Test4RemoveInstanceVar
attr_reader :var
def initialize
@var = 99
end
def remove
remove_instance_variable(:@var)
end
end
tri = Test4RemoveInstanceVar.new
assert_equal 99, tri.var
tri.remove
assert_equal nil, tri.var
assert_raise NameError do
tri.remove
end
end
# Kernel#require is defined in mruby-require. '15.3.1.3.42'
assert('Kernel#respond_to?', '15.3.1.3.43') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment