Sha256: dd0d8bcad317eff890af6c46720a4d51b28fc3d0b14780f4224f0f48fbdfe6e0
Contents?: true
Size: 640 Bytes
Versions: 9
Compression:
Stored size: 640 Bytes
Contents
require "spec_helper" require "cascade/complex_fields/currency" describe Cascade::ComplexFields::Currency do def described_class Cascade::ComplexFields::Currency end subject { described_class.new } describe "parse" do it "return nil if input string isn't number" do assert_nil subject.call("0o") end it "prepare string to use it as bignum" do assert_kind_of BigDecimal, subject.call("1 123 123 45") assert_kind_of BigDecimal, subject.call("1 123, 123 45") end it "return zero if field is empty" do assert_nil subject.call("") assert_nil subject.call(nil) end end end
Version data entries
9 entries across 9 versions & 1 rubygems