summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_case.rb11
-rw-r--r--test/ruby/test_syntax.rb7
2 files changed, 14 insertions, 4 deletions
diff --git a/test/ruby/test_case.rb b/test/ruby/test_case.rb
index 4a0f1bf78d..3725fb49bb 100644
--- a/test/ruby/test_case.rb
+++ b/test/ruby/test_case.rb
@@ -68,10 +68,15 @@ class TestCase < Test::Unit::TestCase
assert(false)
end
- assert_raise(NameError) do
- case
- when false, *x, false
+ begin
+ verbose_bak, $VERBOSE = $VERBOSE, nil
+ assert_raise(NameError) do
+ case
+ when false, *x, false
+ end
end
+ ensure
+ $VERBOSE = verbose_bak
end
end
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index fe6fa30e02..4ed28320b3 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -330,7 +330,12 @@ class TestSyntax < Test::Unit::TestCase
bug10315 = '[ruby-core:65368] [Bug #10315]'
o = KW2.new
- assert_equal([23, 2], o.kw(**{k1: 22}, **{k1: 23}), bug10315)
+ begin
+ verbose_bak, $VERBOSE = $VERBOSE, nil
+ assert_equal([23, 2], eval("o.kw(**{k1: 22}, **{k1: 23}"), bug10315)
+ ensure
+ $VERBOSE = verbose_bak
+ end
h = {k3: 31}
assert_raise(ArgumentError) {o.kw(**h)}