aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-01-01 13:41:24 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2017-01-01 13:41:24 +0100
commitc6c3b130e1123a1a6220b893bd392a954c7f569f (patch)
tree2bdc6a1089173854e75815acef4bd4b2114f0256 /activesupport/test/core_ext/object
parent5053d5251fb8c03e666f1f8b765464ec33e3066e (diff)
downloadrails-c6c3b130e1123a1a6220b893bd392a954c7f569f.tar.gz
rails-c6c3b130e1123a1a6220b893bd392a954c7f569f.tar.bz2
rails-c6c3b130e1123a1a6220b893bd392a954c7f569f.zip
Fix Symbol#duplicable? for Ruby 2.4.0.
Ruby 2.4.0 has trouble duplicating certain symbols created from strings via `to_sym`. It didn't happen with `'symbol'.to_sym.dup` for some reason, but works fine with the longer string sample. Once a newer Ruby version with a fix is released we'll get have a failing test case we can fix. Ref: #27532
Diffstat (limited to 'activesupport/test/core_ext/object')
-rw-r--r--activesupport/test/core_ext/object/duplicable_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/object/duplicable_test.rb b/activesupport/test/core_ext/object/duplicable_test.rb
index f78a5f8496..fb140a5b76 100644
--- a/activesupport/test/core_ext/object/duplicable_test.rb
+++ b/activesupport/test/core_ext/object/duplicable_test.rb
@@ -5,8 +5,8 @@ require "active_support/core_ext/numeric/time"
class DuplicableTest < ActiveSupport::TestCase
if RUBY_VERSION >= "2.4.0"
- RAISE_DUP = [method(:puts), Complex(1), Rational(1)]
- ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56"), nil, false, true, :symbol, 1, 2.3]
+ RAISE_DUP = [method(:puts), Complex(1), Rational(1), 'symbol_from_string'.to_sym]
+ ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56"), nil, false, true, 1, 2.3]
else
RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, method(:puts), Complex(1), Rational(1)]
ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56")]