From 036bdee4d5bdad3b3fa1d57ca292214afe746a09 Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Mon, 19 Jun 2017 19:03:10 +1000 Subject: Make ActiveSupport frozen string literal friendly. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ActiveSupport test suite only passes currently if it uses the latest unreleased commits for dalli, and a patch for Builder: https://github.com/tenderlove/builder/pull/6 Beyond that, all external dependencies (at least, to the extent they’re used by ActiveSupport) are happy, including Nokogiri as of 1.8.0. --- activesupport/test/cache/behaviors/cache_store_behavior.rb | 4 ++-- activesupport/test/cache/behaviors/encoded_key_cache_behavior.rb | 6 +++--- activesupport/test/cache/cache_key_test.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'activesupport/test/cache') diff --git a/activesupport/test/cache/behaviors/cache_store_behavior.rb b/activesupport/test/cache/behaviors/cache_store_behavior.rb index 03c366e164..4631e6aee8 100644 --- a/activesupport/test/cache/behaviors/cache_store_behavior.rb +++ b/activesupport/test/cache/behaviors/cache_store_behavior.rb @@ -196,7 +196,7 @@ module CacheStoreBehavior end def test_original_store_objects_should_not_be_immutable - bar = "bar" + bar = "bar".dup @cache.write("foo", bar) assert_nothing_raised { bar.gsub!(/.*/, "baz") } end @@ -285,7 +285,7 @@ module CacheStoreBehavior end def test_really_long_keys - key = "" + key = "".dup 900.times { key << "x" } assert @cache.write(key, "bar") assert_equal "bar", @cache.read(key) diff --git a/activesupport/test/cache/behaviors/encoded_key_cache_behavior.rb b/activesupport/test/cache/behaviors/encoded_key_cache_behavior.rb index 4d8e2946b2..6adef2916d 100644 --- a/activesupport/test/cache/behaviors/encoded_key_cache_behavior.rb +++ b/activesupport/test/cache/behaviors/encoded_key_cache_behavior.rb @@ -4,7 +4,7 @@ module EncodedKeyCacheBehavior Encoding.list.each do |encoding| define_method "test_#{encoding.name.underscore}_encoded_values" do - key = "foo".force_encoding(encoding) + key = "foo".dup.force_encoding(encoding) assert @cache.write(key, "1", raw: true) assert_equal "1", @cache.read(key) assert_equal "1", @cache.fetch(key) @@ -16,7 +16,7 @@ module EncodedKeyCacheBehavior end def test_common_utf8_values - key = "\xC3\xBCmlaut".force_encoding(Encoding::UTF_8) + key = "\xC3\xBCmlaut".dup.force_encoding(Encoding::UTF_8) assert @cache.write(key, "1", raw: true) assert_equal "1", @cache.read(key) assert_equal "1", @cache.fetch(key) @@ -27,7 +27,7 @@ module EncodedKeyCacheBehavior end def test_retains_encoding - key = "\xC3\xBCmlaut".force_encoding(Encoding::UTF_8) + key = "\xC3\xBCmlaut".dup.force_encoding(Encoding::UTF_8) assert @cache.write(key, "1", raw: true) assert_equal Encoding::UTF_8, key.encoding end diff --git a/activesupport/test/cache/cache_key_test.rb b/activesupport/test/cache/cache_key_test.rb index 149d0f66ee..ea39d7a299 100644 --- a/activesupport/test/cache/cache_key_test.rb +++ b/activesupport/test/cache/cache_key_test.rb @@ -45,7 +45,7 @@ class CacheKeyTest < ActiveSupport::TestCase end def test_expand_cache_key_respond_to_cache_key - key = "foo" + key = "foo".dup def key.cache_key :foo_key end @@ -53,7 +53,7 @@ class CacheKeyTest < ActiveSupport::TestCase end def test_expand_cache_key_array_with_something_that_responds_to_cache_key - key = "foo" + key = "foo".dup def key.cache_key :foo_key end -- cgit v1.2.3