1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Suppress Ruby warning: ⚠️ non-nil $, will be deprecated

This commit is contained in:
Akira Matsuda 2019-07-29 10:46:06 +09:00
parent d880faeefb
commit 62d089a4ad

View file

@ -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"])