summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_syntax.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index c274e333b1..8643bfaf95 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -642,6 +642,8 @@ WARN
assert_equal(42, obj.foo(42))
assert_equal(42, obj.foo(2, _: 0))
assert_equal(2, obj.foo(x: 2, _: 0))
+ ensure
+ self.class.remove_method(:foo)
end
def test_duplicated_opt_kw
@@ -1776,6 +1778,8 @@ eom
assert_warn(/`it`/) {eval('0.times { it; it = 1; it }')}
assert_no_warning(/`it`/) {eval('0.times { it = 1; it }')}
assert_no_warning(/`it`/) {eval('it = 1; 0.times { it }')}
+ ensure
+ self.class.remove_method(:foo)
end
def test_value_expr_in_condition