aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 21:27:34 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 21:27:34 +0000
commit0df938d5be9ebbbbb9828b77370621a908e674ba (patch)
tree42ae54f87c75c4c7acf31dc9f7a6655bd3913a50 /test/uri
parenta8fb40db8cea8ea998a569989168837e1c33c482 (diff)
downloadruby-0df938d5be9ebbbbb9828b77370621a908e674ba.tar.gz
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
Diffstat (limited to 'test/uri')
-rw-r--r--test/uri/test_generic.rb7
1 files changed, 7 insertions, 0 deletions
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)