From 62d089a4ad0170320b851addf76f7f48a49d68d8 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 29 Jul 2019 10:46:06 +0900 Subject: [PATCH] Suppress Ruby warning: :warning: non-nil $, will be deprecated --- actionview/test/template/output_safety_helper_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/actionview/test/template/output_safety_helper_test.rb b/actionview/test/template/output_safety_helper_test.rb index faeeded1c8..b2c6ae99ed 100644 --- a/actionview/test/template/output_safety_helper_test.rb +++ b/actionview/test/template/output_safety_helper_test.rb @@ -43,7 +43,9 @@ class OutputSafetyHelperTest < ActionView::TestCase joined = safe_join(["a", "b"]) assert_equal "ab", joined - $, = "|" + silence_warnings do + $, = "|" + end joined = safe_join(["a", "b"]) assert_equal "a|b", joined ensure @@ -108,7 +110,9 @@ class OutputSafetyHelperTest < ActionView::TestCase test "to_sentence is not affected by $," do separator_was = $, - $, = "|" + silence_warnings do + $, = "|" + end begin assert_equal "one and two", to_sentence(["one", "two"]) assert_equal "one, two, and three", to_sentence(["one", "two", "three"])