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:
parent
d880faeefb
commit
62d089a4ad
1 changed files with 6 additions and 2 deletions
|
@ -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"])
|
||||
|
|
Loading…
Reference in a new issue