Sha256: c523b28794ea6fed7e2dc6d0860908881d14e79a8e94aee24c885dce9baa4a16

Contents?: true

Size: 418 Bytes

Versions: 8

Compression:

Stored size: 418 Bytes

Contents

require "spec_helper"

describe Mongoid::Extensions::BigDecimal::Conversions do

  let(:number) do
    BigDecimal.new("123456.789")
  end

  describe "#get" do

    it "converts the string to a big decimal" do
      BigDecimal.get("123456.789").should == number
    end
  end

  describe "#set" do

    it "converts the big decimal to a string" do
      BigDecimal.set(number).should == "123456.789"
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
mongoid-pre-2.0.0.beta1 spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
mongoid-2.0.0.alpha spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
mongoid-1.2.14 spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
mongoid-1.2.13 spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
mongoid-1.2.12 spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
mongoid-1.2.11 spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
mongoid-1.2.10 spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
mongoid-1.2.9 spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb