test/support/scale_tests.rb in unitwise-0.10.0 vs test/support/scale_tests.rb in unitwise-1.0.0
- old
+ new
@@ -95,9 +95,14 @@
it "should convert from a Float" do
result = described_class.new(4.0, 'foot').simplified_value
result.must_equal 4
result.must_be_kind_of(Integer)
end
+ it "should convert from a BigDecimal" do
+ result = described_class.new(BigDecimal("4.5"), "volt").simplified_value
+ result.must_equal 4.5
+ result.must_be_kind_of(Float)
+ end
end
describe "when the value is equivalent to a Float" do
it "should convert from a BigDecimal" do
result = described_class.new(BigDecimal("1.5"), 'foot').simplified_value
result.must_equal 1.5