From 3d453b409d037a056d0bcd636a2e020cc7cef4a8 Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Tue, 20 Jun 2017 22:20:04 +1000 Subject: Make ActionView frozen string literal friendly. Plus a couple of related ActionPack patches. --- .../activerecord/form_helper_activerecord_test.rb | 4 +- actionview/test/fixtures/ruby_template.ruby | 2 +- actionview/test/template/atom_feed_helper_test.rb | 2 +- actionview/test/template/date_helper_test.rb | 374 ++++++++++----------- .../test/template/form_helper/form_with_test.rb | 10 +- actionview/test/template/form_helper_test.rb | 6 +- actionview/test/template/form_tag_helper_test.rb | 4 +- actionview/test/template/javascript_helper_test.rb | 4 +- actionview/test/template/render_test.rb | 4 +- actionview/test/template/streaming_render_test.rb | 2 +- actionview/test/template/template_test.rb | 2 +- actionview/test/template/text_helper_test.rb | 8 +- actionview/test/template/url_helper_test.rb | 2 +- 13 files changed, 212 insertions(+), 212 deletions(-) (limited to 'actionview/test') diff --git a/actionview/test/activerecord/form_helper_activerecord_test.rb b/actionview/test/activerecord/form_helper_activerecord_test.rb index 3b314588c7..9949c3fde0 100644 --- a/actionview/test/activerecord/form_helper_activerecord_test.rb +++ b/actionview/test/activerecord/form_helper_activerecord_test.rb @@ -55,7 +55,7 @@ class FormHelperActiveRecordTest < ActionView::TestCase private def hidden_fields(method = nil) - txt = %{} + txt = %{}.dup if method && !%w(get post).include?(method.to_s) txt << %{} @@ -65,7 +65,7 @@ class FormHelperActiveRecordTest < ActionView::TestCase end def form_text(action = "/", id = nil, html_class = nil, remote = nil, multipart = nil, method = nil) - txt = %{
'') + new_xml = Builder::XmlMarkup.new(:target=>''.dup) atom_feed(:xml => new_xml) do |feed| feed.title("My great blog!") feed.updated(@scrolls.first.created_at) diff --git a/actionview/test/template/date_helper_test.rb b/actionview/test/template/date_helper_test.rb index b667303318..b9b8194e69 100644 --- a/actionview/test/template/date_helper_test.rb +++ b/actionview/test/template/date_helper_test.rb @@ -214,7 +214,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -223,7 +223,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -232,7 +232,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day_nil_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -240,7 +240,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day_with_two_digit_numbers - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -249,7 +249,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day_with_html_options - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -258,7 +258,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day_with_default_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -266,7 +266,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day_with_custom_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -274,7 +274,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day_with_generic_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -282,7 +282,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_day_with_custom_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -290,7 +290,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -299,7 +299,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_two_digit_numbers - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -308,7 +308,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_disabled - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -317,7 +317,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_field_name_override - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -326,7 +326,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -335,7 +335,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_nil_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -343,7 +343,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_numbers - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -352,7 +352,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_numbers_and_names - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -361,7 +361,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_format_string - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -371,7 +371,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_numbers_and_names_with_abbv - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -380,7 +380,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_abbv - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -391,7 +391,7 @@ class DateHelperTest < ActionView::TestCase def test_select_month_with_custom_names month_names = %w(nil Januar Februar Marts April Maj Juni Juli August September Oktober November December) - expected = %(\n).dup 1.upto(12) { |month| expected << %(\n) } expected << "\n" @@ -402,7 +402,7 @@ class DateHelperTest < ActionView::TestCase def test_select_month_with_zero_indexed_custom_names month_names = %w(Januar Februar Marts April Maj Juni Juli August September Oktober November December) - expected = %(\n).dup 1.upto(12) { |month| expected << %(\n) } expected << "\n" @@ -419,7 +419,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_html_options - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -427,7 +427,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_default_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -435,7 +435,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_custom_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -443,7 +443,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_generic_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -451,7 +451,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_month_with_custom_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -459,7 +459,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -468,7 +468,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_disabled - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -477,7 +477,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_field_name_override - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -486,7 +486,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_type_discarding - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -497,7 +497,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_descending - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -514,7 +514,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_html_options - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -522,7 +522,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_default_prompt - expected = %(\n).dup expected << %(\n\n\n\n) expected << "\n" @@ -530,7 +530,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_custom_prompt - expected = %(\n).dup expected << %(\n\n\n\n) expected << "\n" @@ -538,7 +538,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_generic_with_css_classes - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -546,7 +546,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_custom_with_css_classes - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -554,14 +554,14 @@ class DateHelperTest < ActionView::TestCase end def test_select_year_with_position - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" assert_dom_equal expected, select_year(Date.current, include_position: true, start_year: 2003, end_year: 2005) end def test_select_hour - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -569,7 +569,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_ampm - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -577,7 +577,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_disabled - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -585,7 +585,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_field_name_override - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -593,7 +593,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -601,7 +601,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_nil_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -609,7 +609,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_html_options - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -617,7 +617,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_default_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -625,7 +625,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_custom_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -633,7 +633,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_generic_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -641,7 +641,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_hour_with_custom_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -649,7 +649,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -657,7 +657,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_disabled - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -665,7 +665,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_field_name_override - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -673,7 +673,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -681,7 +681,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_blank_and_step - expected = %(\n).dup expected << %(\n\n\n\n\n) expected << "\n" @@ -689,7 +689,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_nil_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -697,7 +697,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_nil_with_blank_and_step - expected = %(\n).dup expected << %(\n\n\n\n\n) expected << "\n" @@ -713,7 +713,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_html_options - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -721,7 +721,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_default_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -729,7 +729,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_custom_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -737,7 +737,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_generic_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -745,7 +745,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_minute_with_custom_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -753,7 +753,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -761,7 +761,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_with_disabled - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -769,7 +769,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_with_field_name_override - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -777,7 +777,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -785,7 +785,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_nil_with_blank - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -793,7 +793,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_with_html_options - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -801,7 +801,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_with_default_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -809,7 +809,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_with_custom_prompt - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -817,7 +817,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_with_generic_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -825,7 +825,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_second_with_custom_with_css_classes - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -833,7 +833,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -858,7 +858,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_order - expected = %(\n).dup expected << %(\n\n\n\n\n\n\n\n\n\n\n\n) expected << "\n" @@ -875,7 +875,7 @@ class DateHelperTest < ActionView::TestCase def test_select_date_with_incomplete_order # Since the order is incomplete nothing will be shown - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -883,7 +883,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_disabled - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -899,7 +899,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_no_start_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 1) do |y| if y == Date.today.year expected << %(\n) @@ -923,7 +923,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_no_end_year - expected = %(\n).dup 2003.upto(2008) do |y| if y == 2003 expected << %(\n) @@ -947,7 +947,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_no_start_or_end_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 5) do |y| if y == Date.today.year expected << %(\n) @@ -971,7 +971,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_zero_value - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -987,7 +987,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_zero_value_and_no_start_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 1) { |y| expected << %(\n) } expected << "\n" @@ -1003,7 +1003,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_zero_value_and_no_end_year - expected = %(\n).dup last_year = Time.now.year + 5 2003.upto(last_year) { |y| expected << %(\n) } expected << "\n" @@ -1020,7 +1020,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_zero_value_and_no_start_and_end_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 5) { |y| expected << %(\n) } expected << "\n" @@ -1036,7 +1036,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_nil_value_and_no_start_and_end_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 5) { |y| expected << %(\n) } expected << "\n" @@ -1052,7 +1052,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_html_options - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1068,7 +1068,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_separator - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1088,7 +1088,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_separator_and_discard_day - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1104,7 +1104,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_separator_discard_month_and_day - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1115,7 +1115,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_hidden - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1124,7 +1124,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_css_classes_option - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1140,7 +1140,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_custom_with_css_classes - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1156,7 +1156,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_css_classes_option_and_html_class_option - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1172,7 +1172,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_custom_with_css_classes_and_html_class_option - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1188,7 +1188,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_partial_with_css_classes_and_html_class_option - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1204,7 +1204,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_date_with_html_class_option - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1220,7 +1220,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1248,7 +1248,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_ampm - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1276,7 +1276,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_separators - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1304,7 +1304,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_nil_value_and_no_start_and_end_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 5) { |y| expected << %(\n) } expected << "\n" @@ -1332,7 +1332,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_html_options - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1360,7 +1360,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_all_separators - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1396,7 +1396,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_default_prompt - expected = %(\n).dup expected << %(\n\n\n\n) expected << "\n" @@ -1425,7 +1425,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_custom_prompt - expected = %(\n).dup expected << %(\n\n\n\n) expected << "\n" @@ -1454,7 +1454,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_generic_with_css_classes - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1482,7 +1482,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_custom_with_css_classes - expected = %(\n).dup expected << %(\n\n\n) expected << "\n" @@ -1510,7 +1510,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_custom_hours - expected = %(\n).dup expected << %(\n\n\n\n) expected << "\n" @@ -1539,7 +1539,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_datetime_with_hidden - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) expected << %(\n) @@ -1551,7 +1551,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1570,7 +1570,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_ampm - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1588,7 +1588,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_separator - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) expected << %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1630,7 +1630,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_seconds_and_separator - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1654,7 +1654,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_html_options - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1677,7 +1677,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_default_prompt - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1701,7 +1701,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_custom_prompt - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1726,7 +1726,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_generic_with_css_classes - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1750,7 +1750,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_custom_with_css_classes - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) @@ -1774,7 +1774,7 @@ class DateHelperTest < ActionView::TestCase end def test_select_time_with_hidden - expected = %(\n) + expected = %(\n).dup expected << %(\n) expected << %(\n) expected << %(\n) @@ -1788,7 +1788,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -1808,7 +1808,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -1828,7 +1828,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -1866,7 +1866,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = "\n" + expected = "\n".dup expected << %{\n" + expected = "\n".dup expected << "\n" expected << %{\n" + expected = "\n".dup expected << %{\n" + expected = "\n".dup expected << %{\n\n\n\n\n\n\n\n\n\n\n\n\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -1953,7 +1953,7 @@ class DateHelperTest < ActionView::TestCase concat f.date_select(:written_on) end - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -1969,7 +1969,7 @@ class DateHelperTest < ActionView::TestCase concat f.date_select(:written_on) end - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -1981,7 +1981,7 @@ class DateHelperTest < ActionView::TestCase @post.written_on = Date.new(2004, 6, 15) id = 456 - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2001,7 +2001,7 @@ class DateHelperTest < ActionView::TestCase @post.written_on = Date.new(2004, 6, 15) id = 123 - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2020,7 +2020,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup 1.upto(31) { |i| expected << %(\n) } expected << "\n" @@ -2040,7 +2040,7 @@ class DateHelperTest < ActionView::TestCase start_year = Time.now.year - 5 end_year = Time.now.year + 5 - expected = %{\n}.dup start_year.upto(end_year) { |i| expected << %(\n) } expected << "\n" @@ -2060,7 +2060,7 @@ class DateHelperTest < ActionView::TestCase start_year = Time.now.year - 5 end_year = Time.now.year + 5 - expected = %{\n}.dup expected << "\n" start_year.upto(end_year) { |i| expected << %(\n) } expected << "\n" @@ -2104,7 +2104,7 @@ class DateHelperTest < ActionView::TestCase start_year = Time.now.year - 5 end_year = Time.now.year + 5 - expected = %{\n}.dup expected << "\n" start_year.upto(end_year) { |i| expected << %(\n) } expected << "\n" @@ -2136,7 +2136,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2155,7 +2155,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2179,7 +2179,7 @@ class DateHelperTest < ActionView::TestCase concat f.date_select(:written_on, {}, class: "selector") end - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2199,7 +2199,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2223,7 +2223,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2246,7 +2246,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2264,7 +2264,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2284,7 +2284,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2304,7 +2304,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2324,7 +2324,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Date.new(2004, 6, 15) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2344,7 +2344,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2363,7 +2363,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2382,7 +2382,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2401,7 +2401,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %(\n).dup 0.upto(23) { |i| expected << %(\n) } expected << "\n" expected << " : " @@ -2416,7 +2416,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2439,7 +2439,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2462,7 +2462,7 @@ class DateHelperTest < ActionView::TestCase concat f.time_select(:written_on, {}, class: "selector") end - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2481,7 +2481,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2508,7 +2508,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2529,7 +2529,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2550,7 +2550,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2571,7 +2571,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2592,7 +2592,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -2611,7 +2611,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = Time.local(2004, 6, 15, 16, 35) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2640,7 +2640,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = Time.local(2004, 6, 15, 16, 35) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2706,7 +2706,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2741,7 +2741,7 @@ class DateHelperTest < ActionView::TestCase concat f.datetime_select(:updated_at, {}, class: "selector") end - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} expected << %{ — \n} @@ -2754,7 +2754,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2807,7 +2807,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = nil - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2836,7 +2836,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = nil - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2865,7 +2865,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2894,7 +2894,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.written_on = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -2920,7 +2920,7 @@ class DateHelperTest < ActionView::TestCase end def test_date_select_with_zero_value_and_no_start_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 1) { |y| expected << %(\n) } expected << "\n" @@ -2936,7 +2936,7 @@ class DateHelperTest < ActionView::TestCase end def test_date_select_with_zero_value_and_no_end_year - expected = %(\n).dup last_year = Time.now.year + 5 2003.upto(last_year) { |y| expected << %(\n) } expected << "\n" @@ -2953,7 +2953,7 @@ class DateHelperTest < ActionView::TestCase end def test_date_select_with_zero_value_and_no_start_and_end_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 5) { |y| expected << %(\n) } expected << "\n" @@ -2969,7 +2969,7 @@ class DateHelperTest < ActionView::TestCase end def test_date_select_with_nil_value_and_no_start_and_end_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 5) { |y| expected << %(\n) } expected << "\n" @@ -2985,7 +2985,7 @@ class DateHelperTest < ActionView::TestCase end def test_datetime_select_with_nil_value_and_no_start_and_end_year - expected = %(\n).dup (Date.today.year - 5).upto(Date.today.year + 5) { |y| expected << %(\n) } expected << "\n" @@ -3017,7 +3017,7 @@ class DateHelperTest < ActionView::TestCase @post.updated_at = Time.local(2004, 6, 15, 16, 35) id = 456 - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -3051,7 +3051,7 @@ class DateHelperTest < ActionView::TestCase concat f.datetime_select(:updated_at) end - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -3081,7 +3081,7 @@ class DateHelperTest < ActionView::TestCase @post.updated_at = Time.local(2004, 6, 15, 16, 35) id = @post.id - expected = %{\n}.dup expected << %{\n\n\n\n\n\n\n\n\n\n\n} expected << "\n" @@ -3110,7 +3110,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n}.dup 1999.upto(2009) { |i| expected << %(\n) } expected << "\n" expected << %{\n} + expected = %{\n}.dup expected << %{\n" @@ -3166,7 +3166,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n}.dup 1999.upto(2009) { |i| expected << %(\n) } expected << "\n" expected << %{\n} @@ -3189,7 +3189,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -3208,7 +3208,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n} + expected = %{\n}.dup expected << %{\n} expected << %{\n} @@ -3227,7 +3227,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = Time.local(2004, 6, 15, 15, 16, 35) - expected = %{\n}.dup 1999.upto(2009) { |i| expected << %(\n) } expected << "\n" expected << %{\n} + expected = %{\n" expected << %{\n} + expected = %{\n" expected << %{\n} + expected = %{\n" expected << %{\n} + expected = %{\n}.dup expected << %{\n" @@ -3344,7 +3344,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = nil - expected = %{\n}.dup 2001.upto(2011) { |i| expected << %(\n) } expected << "\n" expected << %{\n} + expected = %{\n" @@ -3391,7 +3391,7 @@ class DateHelperTest < ActionView::TestCase @post = Post.new @post.updated_at = nil - expected = %{\n}.dup (Time.now.year - 5).upto(Time.now.year + 5) { |i| expected << %(\n) } expected << "\n" expected << %{\n} + expected = %{\n" diff --git a/actionview/test/template/form_helper/form_with_test.rb b/actionview/test/template/form_helper/form_with_test.rb index ecdd5ce672..df81315b9c 100644 --- a/actionview/test/template/form_helper/form_with_test.rb +++ b/actionview/test/template/form_helper/form_with_test.rb @@ -16,7 +16,7 @@ class FormWithActsLikeFormTagTest < FormWithTest method = options[:method] skip_enforcing_utf8 = options.fetch(:skip_enforcing_utf8, false) - "".tap do |txt| + "".dup.tap do |txt| unless skip_enforcing_utf8 txt << %{} end @@ -32,7 +32,7 @@ class FormWithActsLikeFormTagTest < FormWithTest method = method.to_s == "get" ? "get" : "post" - txt = %{} + txt = %{}.dup end if method && !%w(get post).include?(method.to_s) @@ -2207,7 +2207,7 @@ class FormWithActsLikeFormForTest < FormWithTest end def form_text(action = "/", id = nil, html_class = nil, local = nil, multipart = nil, method = nil) - txt = %{} + txt = %{}.dup else - txt = "" + txt = "".dup end if method && !%w(get post).include?(method.to_s) @@ -3459,7 +3459,7 @@ class FormHelperTest < ActionView::TestCase end def form_text(action = "/", id = nil, html_class = nil, remote = nil, multipart = nil, method = nil) - txt = %{} end @@ -30,7 +30,7 @@ class FormTagHelperTest < ActionView::TestCase method = method.to_s == "get" ? "get" : "post" - txt = %{ tags), escape_javascript(%(dont tags)) - assert_equal %(unicode 
 newline), escape_javascript(%(unicode \342\200\250 newline).force_encoding(Encoding::UTF_8).encode!) - assert_equal %(unicode 
 newline), escape_javascript(%(unicode \342\200\251 newline).force_encoding(Encoding::UTF_8).encode!) + assert_equal %(unicode 
 newline), escape_javascript(%(unicode \342\200\250 newline).dup.force_encoding(Encoding::UTF_8).encode!) + assert_equal %(unicode 
 newline), escape_javascript(%(unicode \342\200\251 newline).dup.force_encoding(Encoding::UTF_8).encode!) assert_equal %(dont <\\/close> tags), j(%(dont tags)) end diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index 9999607067..1fd8b4fe1a 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -439,7 +439,7 @@ module RenderTestCases end CustomHandler = lambda do |template| - "@output_buffer = ''\n" \ + "@output_buffer = ''.dup\n" \ "@output_buffer << 'source: #{template.source.inspect}'\n" end @@ -583,7 +583,7 @@ module RenderTestCases def test_render_with_passing_couple_extensions_to_one_register_template_handler_function_call ActionView::Template.register_template_handler :foo1, :foo2, CustomHandler - assert_equal @view.render(inline: "Hello, World!", type: :foo1), @view.render(inline: "Hello, World!", type: :foo2) + assert_equal @view.render(inline: "Hello, World!".dup, type: :foo1), @view.render(inline: "Hello, World!".dup, type: :foo2) ensure ActionView::Template.unregister_template_handler :foo1, :foo2 end diff --git a/actionview/test/template/streaming_render_test.rb b/actionview/test/template/streaming_render_test.rb index 6ce66a1275..41b9063417 100644 --- a/actionview/test/template/streaming_render_test.rb +++ b/actionview/test/template/streaming_render_test.rb @@ -17,7 +17,7 @@ class FiberedTest < ActiveSupport::TestCase def buffered_render(options) body = render_body(options) - string = "" + string = "".dup body.each do |piece| string << piece end diff --git a/actionview/test/template/template_test.rb b/actionview/test/template/template_test.rb index 9d31a98703..dd131f0246 100644 --- a/actionview/test/template/template_test.rb +++ b/actionview/test/template/template_test.rb @@ -53,7 +53,7 @@ class TestERBTemplate < ActiveSupport::TestCase end def new_template(body = "<%= hello %>", details = { format: :html }) - ActionView::Template.new(body, "hello template", details.fetch(:handler) { ERBHandler }, { virtual_path: "hello" }.merge!(details)) + ActionView::Template.new(body.dup, "hello template", details.fetch(:handler) { ERBHandler }, { virtual_path: "hello" }.merge!(details)) end def render(locals = {}) diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index 251c98230f..21ee4cc8e5 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -11,7 +11,7 @@ class TextHelperTest < ActionView::TestCase end def test_concat - self.output_buffer = "foo" + self.output_buffer = "foo".dup assert_equal "foobar", concat("bar") assert_equal "foobar", output_buffer end @@ -104,8 +104,8 @@ class TextHelperTest < ActionView::TestCase end def test_truncate_multibyte - assert_equal "\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254 ...".force_encoding(Encoding::UTF_8), - truncate("\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254 \354\225\204\353\235\274\353\246\254\354\230\244".force_encoding(Encoding::UTF_8), length: 10) + assert_equal "\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254 ...".dup.force_encoding(Encoding::UTF_8), + truncate("\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254 \354\225\204\353\235\274\353\246\254\354\230\244".dup.force_encoding(Encoding::UTF_8), length: 10) end def test_truncate_does_not_modify_the_options_hash @@ -325,7 +325,7 @@ class TextHelperTest < ActionView::TestCase end def test_excerpt_with_utf8 - assert_equal("...\357\254\203ciency could not be...".force_encoding(Encoding::UTF_8), excerpt("That's why e\357\254\203ciency could not be helped".force_encoding(Encoding::UTF_8), "could", radius: 8)) + assert_equal("...\357\254\203ciency could not be...".dup.force_encoding(Encoding::UTF_8), excerpt("That's why e\357\254\203ciency could not be helped".dup.force_encoding(Encoding::UTF_8), "could", radius: 8)) end def test_excerpt_does_not_modify_the_options_hash diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb index 30dc719ce6..b818e28483 100644 --- a/actionview/test/template/url_helper_test.rb +++ b/actionview/test/template/url_helper_test.rb @@ -535,7 +535,7 @@ class UrlHelperTest < ActiveSupport::TestCase def test_current_page_with_escaped_params_with_different_encoding @request = request_for_url("/") - @request.stub(:path, "/category/administra%c3%a7%c3%a3o".force_encoding(Encoding::ASCII_8BIT)) do + @request.stub(:path, "/category/administra%c3%a7%c3%a3o".dup.force_encoding(Encoding::ASCII_8BIT)) do assert current_page?(controller: "foo", action: "category", category: "administraĆ§Ć£o") assert current_page?("http://www.example.com/category/administra%c3%a7%c3%a3o") end -- cgit v1.2.3