scrooge 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/scrooge.rb +2 -2
- data/scrooge.gemspec +1 -1
- data/spec/scrooge_spec.rb +10 -0
- metadata +1 -1
data/lib/scrooge.rb
CHANGED
data/scrooge.gemspec
CHANGED
data/spec/scrooge_spec.rb
CHANGED
@@ -45,6 +45,16 @@ describe Money do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
+
describe "converting to string" do
|
49
|
+
it "truncates 2 characters after the decimal point" do
|
50
|
+
(0.975).to_money.to_s.should == "0.97"
|
51
|
+
end
|
52
|
+
|
53
|
+
it "expands to two decimal places when there're less" do
|
54
|
+
0.to_money.to_s.should == "0.00"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
48
58
|
describe "extending core classes" do
|
49
59
|
it "allows to convert integers to money objects" do
|
50
60
|
2.to_money.should == Money.new(200)
|