spec/money/money_spec.rb in nofxx-money-2.3.10 vs spec/money/money_spec.rb in nofxx-money-2.3.11
- old
+ new
@@ -212,10 +212,13 @@
end
it { @cash.format.should eql("¥2.00") }
it { @cash.format(:symbol => "R$ ").should eql("R$ 2.00") }
it { @cash.format(:no_cents => true).should eql("¥2") }
it { @cash.format(:no_cents => true, :symbol => "R$ ").should eql("R$ 2") }
+ it { @cash.format(:symbol => false).should eql("2.00") }
+ it { @cash.format(:symbol => nil).should eql("2.00") }
+ it { @cash.format(:symbol => "").should eql("2.00") }
it { @cash.format(:html => true).should eql("¥2.00") }
end
it { Money.new(0).format.should eql("$0.00") }
it { Money.new(0).format(:display_free => true).should eql("free") }
@@ -257,9 +260,17 @@
(Money.new(10_00, "USD") + Money.new(90, "USD")).should == Money.new(10_90, "USD")
end
it "#- substracts the other object's amount from the current object's amount while retaining the currency" do
(Money.new(10_00, "USD") - Money.new(90, "USD")).should == Money.new(9_10, "USD")
+ end
+
+ it "should return to -@ method" do
+ (-(Money.new(5))).cents.should eql(-5)
+ end
+
+ it "should return to -@ method" do
+ (-(Money.new(-5))).cents.should eql(5)
end
end
describe "if the other Money object has a different currency" do
it "#<=> compares the two objects' amount after converting the other object's amount to its own currency" do