summaryrefslogtreecommitdiff
path: root/test/psych/test_numeric.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/test_numeric.rb')
-rw-r--r--test/psych/test_numeric.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/psych/test_numeric.rb b/test/psych/test_numeric.rb
index 9adb058a32..bae723aca9 100644
--- a/test/psych/test_numeric.rb
+++ b/test/psych/test_numeric.rb
@@ -1,4 +1,5 @@
require 'psych/helper'
+require 'bigdecimal'
module Psych
###
@@ -10,5 +11,15 @@ module Psych
str = Psych.load('--- 090')
assert_equal '090', str
end
+
+ def test_big_decimal_tag
+ decimal = BigDecimal("12.34")
+ assert_match "!ruby/object:BigDecimal", Psych.dump(decimal)
+ end
+
+ def test_big_decimal_round_trip
+ decimal = BigDecimal("12.34")
+ assert_cycle decimal
+ end
end
end