aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/big_decimal/yaml_conversions_test.rb
blob: e634679d2012b58fafdb19d1b8753558b42a44be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
require 'abstract_unit'

class BigDecimalYamlConversionsTest < ActiveSupport::TestCase
  def test_to_yaml
    assert_deprecated { require 'active_support/core_ext/big_decimal/yaml_conversions' }
    assert_match("--- 100000.30020320320000000000000000000000000000001\n", BigDecimal.new('100000.30020320320000000000000000000000000000001').to_yaml)
    assert_match("--- .Inf\n",  BigDecimal.new('Infinity').to_yaml)
    assert_match("--- .NaN\n",  BigDecimal.new('NaN').to_yaml)
    assert_match("--- -.Inf\n", BigDecimal.new('-Infinity').to_yaml)
  end
end