Sha256: 985a666b70415668d269f62abe4ec464aaf009ad5ce57d586ca80988265bf856
Contents?: true
Size: 939 Bytes
Versions: 1
Compression:
Stored size: 939 Bytes
Contents
require File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "spec_helper") include TwitterCldr::Formatters describe CurrencyFormatter do describe "#format" do before(:each) do @formatter = CurrencyFormatter.new(:locale => :msa) end it "should use a dollar sign when no other currency symbol is given (and default to a precision of 2)" do @formatter.format(12).should == "$12.00" end it "should use the specified currency symbol when specified" do # S/. is the symbol for the Peruvian Nuevo Sol, just in case you were curious @formatter.format(12, :currency => "S/.").should == "S/.12.00" end it "should use the currency symbol for the corresponding currency code" do @formatter.format(12, :currency => "PEN").should == "S/.12.00" end it "overrides the default precision" do @formatter.format(12, :precision => 3).should == "$12.000" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
twitter_cldr-1.0.0 | spec/formatters/numbers/currency_formatter_spec.rb |