From 8040f527c3f75638829809662a52af04d50369f9 Mon Sep 17 00:00:00 2001 From: kenta-s Date: Sun, 15 Jan 2017 21:10:05 +0900 Subject: Fix unexpected behavior of with $, --- actionview/test/template/output_safety_helper_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionview/test') diff --git a/actionview/test/template/output_safety_helper_test.rb b/actionview/test/template/output_safety_helper_test.rb index 8691bb11ee..41ae36e91a 100644 --- a/actionview/test/template/output_safety_helper_test.rb +++ b/actionview/test/template/output_safety_helper_test.rb @@ -87,4 +87,14 @@ class OutputSafetyHelperTest < ActionView::TestCase assert_equal "one, two three", to_sentence(["one", "two", "three"], last_word_connector: " ") assert_equal "one, two and three", to_sentence(["one", "two", "three"], last_word_connector: " and ") end + + test "to_sentence is not affected by $," do + $, = "|" + begin + assert_equal "one and two", to_sentence(["one", "two"]) + assert_equal "one, two, and three", to_sentence(["one", "two", "three"]) + ensure + $, = nil + end + end end -- cgit v1.2.3