aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/duplicable_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/duplicable_test.rb')
-rw-r--r--activesupport/test/core_ext/duplicable_test.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/activesupport/test/core_ext/duplicable_test.rb b/activesupport/test/core_ext/duplicable_test.rb
index 3e54266051..e0566e012c 100644
--- a/activesupport/test/core_ext/duplicable_test.rb
+++ b/activesupport/test/core_ext/duplicable_test.rb
@@ -4,9 +4,17 @@ require 'active_support/core_ext/object/duplicable'
require 'active_support/core_ext/numeric/time'
class DuplicableTest < ActiveSupport::TestCase
- RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, BigDecimal.new('4.56'), 5.seconds]
- YES = ['1', Object.new, /foo/, [], {}, Time.now]
- NO = [Class.new, Module.new]
+ RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, 5.seconds]
+ YES = ['1', Object.new, /foo/, [], {}, Time.now, Class.new, Module.new]
+ NO = []
+
+ begin
+ bd = BigDecimal.new('4.56')
+ YES << bd.dup
+ rescue TypeError
+ RAISE_DUP << bd
+ end
+
def test_duplicable
(RAISE_DUP + NO).each do |v|
@@ -14,7 +22,7 @@ class DuplicableTest < ActiveSupport::TestCase
end
YES.each do |v|
- assert v.duplicable?
+ assert v.duplicable?, "#{v.class} should be duplicable"
end
(YES + NO).each do |v|