From 59aaca973b367ae8bec8b8af4e6cea794124ee79 Mon Sep 17 00:00:00 2001 From: normal Date: Tue, 8 Dec 2015 21:27:34 +0000 Subject: test/uri/test_generic.rb (to_s): new test Ensure URI::Generic#to_s continues to return mutable strings to prevent breakage when we enable frozen string literals in future commits. [ruby-core:71820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/uri/test_generic.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/uri') diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb index c0597b91dc..0a068c351b 100644 --- a/test/uri/test_generic.rb +++ b/test/uri/test_generic.rb @@ -14,6 +14,13 @@ class URI::TestGeneric < Test::Unit::TestCase uri.class.component.collect {|c| uri.send(c)} end + def test_to_s + exp = 'http://example.com/'.freeze + str = URI(exp).to_s + assert_equal exp, str + refute_predicate str, :frozen?, '[ruby-core:71785] [Bug #11759]' + end + def test_parse # 0 assert_kind_of(URI::HTTP, @base_url) -- cgit v1.2.3