From f7950b480c0acf7fdc7be948a58dabbefc105855 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Wed, 25 Jan 2017 09:35:39 +0900 Subject: Keep the value of `$,` and restore it As unit tests, we do not know the value of `$,` when this test case started. It' better to keep the value when the test case fnished. --- actionview/test/template/output_safety_helper_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionview') diff --git a/actionview/test/template/output_safety_helper_test.rb b/actionview/test/template/output_safety_helper_test.rb index 0f3288130b..263c25ab49 100644 --- a/actionview/test/template/output_safety_helper_test.rb +++ b/actionview/test/template/output_safety_helper_test.rb @@ -94,12 +94,13 @@ class OutputSafetyHelperTest < ActionView::TestCase end test "to_sentence is not affected by $," do + separator_was = $, $, = "|" begin assert_equal "one and two", to_sentence(["one", "two"]) assert_equal "one, two, and three", to_sentence(["one", "two", "three"]) ensure - $, = nil + $, = separator_was end end end -- cgit v1.2.3