aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorclaudiob <claudiob@gmail.com>2014-11-28 18:28:07 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-04 15:54:20 -0300
commit7926ab1004d2ec9118516445d32c75c9aaacba79 (patch)
tree85b919ef66e1b3244d520e75dc97756aa37a153b /activesupport/test/core_ext
parentb2bb2a462f8950522688e8e0d87a7d32a5863438 (diff)
downloadrails-7926ab1004d2ec9118516445d32c75c9aaacba79.tar.gz
rails-7926ab1004d2ec9118516445d32c75c9aaacba79.tar.bz2
rails-7926ab1004d2ec9118516445d32c75c9aaacba79.zip
Remove hack to support BigDecimal in Ruby 1.9
Now that Rails requires Ruby >= 2.0, there is no need to check whether `BigDecimal` exists or not.
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/object/duplicable_test.rb11
1 files changed, 1 insertions, 10 deletions
diff --git a/activesupport/test/core_ext/object/duplicable_test.rb b/activesupport/test/core_ext/object/duplicable_test.rb
index 8cc39ae7b9..d37f4bd0d8 100644
--- a/activesupport/test/core_ext/object/duplicable_test.rb
+++ b/activesupport/test/core_ext/object/duplicable_test.rb
@@ -6,16 +6,7 @@ require 'active_support/core_ext/numeric/time'
class DuplicableTest < ActiveSupport::TestCase
RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, method(:puts)]
ALLOW_DUP = ['1', Object.new, /foo/, [], {}, Time.now, Class.new, Module.new]
-
- # Needed to support Ruby 1.9.x, as it doesn't allow dup on BigDecimal, instead
- # raises TypeError exception. Checking here on the runtime whether BigDecimal
- # will allow dup or not.
- begin
- bd = BigDecimal.new('4.56')
- ALLOW_DUP << bd.dup
- rescue TypeError
- RAISE_DUP << bd
- end
+ ALLOW_DUP << BigDecimal.new('4.56')
def test_duplicable
RAISE_DUP.each do |v|