From ecce6b524c28ba398105eac554d31a09e2474231 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 2 Oct 2017 11:43:36 +0000 Subject: test_call.rb: refine test_safe_call * test/ruby/test_call.rb (test_safe_call): rhs should not be evaluated when the receiver is nil. simplified the assertion for [Bug #13964]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_call.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb index 18203ce731..2a1b671cac 100644 --- a/test/ruby/test_call.rb +++ b/test/ruby/test_call.rb @@ -50,9 +50,9 @@ class TestCall < Test::Unit::TestCase o = nil assert_nil(o&.x) - assert_nothing_raised(NoMethodError) {o&.x = 6} - assert_nothing_raised(NoMethodError) {o&.x *= 7} - assert_nothing_raised(NoMethodError) {o&.x *= 8; [].each {}} + assert_nothing_raised(NoMethodError) {o&.x = raise} + assert_nothing_raised(NoMethodError) {o&.x *= raise} + assert_nothing_raised(NoMethodError) {o&.x *= raise; nil} end def test_safe_call_evaluate_arguments_only_method_call_is_made -- cgit v1.2.3