summaryrefslogtreecommitdiff
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
parenta8fb40db8cea8ea998a569989168837e1c33c482 (diff)
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
-rw-r--r--ChangeLog5
-rw-r--r--test/uri/test_generic.rb7
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b028a1d440..912984afb69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Dec 9 06:25:47 2015 Eric Wong <e@80x24.org>
+
+ * test/uri/test_generic.rb (to_s): new test
+ [ruby-core:71820]
+
Wed Dec 9 02:18:52 2015 Koichi Sasada <ko1@atdot.net>
* compile.c (ibf_dump_memsize): should check NULL.
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index c0597b91dc0..0a068c351bf 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)