Sha256: dcf1e84234a791f9607cf291ded9beeb5f37b7fc9d5b9d0c47a7dd369ad48049

Contents?: true

Size: 732 Bytes

Versions: 29

Compression:

Stored size: 732 Bytes

Contents

require 'spec_helper'
require 'bigdecimal'

describe SitemapGenerator::BigDecimal do
  describe "to_yaml" do
    it "should serialize correctly" do
      SitemapGenerator::BigDecimal.new('100000.30020320320000000000000000000000000000001').to_yaml.should =~ /^--- 100000\.30020320320000000000000000000000000000001\n/
      SitemapGenerator::BigDecimal.new('Infinity').to_yaml.should =~ /^--- \.Inf\n/
      SitemapGenerator::BigDecimal.new('NaN').to_yaml.should =~ /^--- \.NaN\n/
      SitemapGenerator::BigDecimal.new('-Infinity').to_yaml.should =~ /^--- -\.Inf\n/
    end
  end

  describe "to_d" do
    it "should convert correctly" do
      bd = SitemapGenerator::BigDecimal.new '10'
      bd.to_d.should == bd
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
sitemap_generator-5.2.0 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.1.0 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.0.5 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
ftbpro_sitemap_generator-5.0.8 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator_ftbpro-5.0.6 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator_ftbpro-5.0.5 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator_ftbpro-5.0.4 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.0.4 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.0.3 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.0.2 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.0.1 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.0.0 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.0.0.beta1 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-5.0.0.beta spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-4.3.1 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-4.3.0 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-4.2.0 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-4.1.1 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-4.1.0 spec/sitemap_generator/core_ext/bigdecimal_spec.rb
sitemap_generator-4.0.1 spec/sitemap_generator/core_ext/bigdecimal_spec.rb