Sha256: 69befd82d9b857500c26d76c4b4035f5bc816383586cc8afbefce70c50b44365
Contents?: true
Size: 1.65 KB
Versions: 1
Compression:
Stored size: 1.65 KB
Contents
require File.join(File.dirname(__FILE__), %w[.. spec_helper]) include TwitterCldr::Shared TEST_COUNTRIES = ["Australia", "Thailand", "Russia", "China", "Japan", "Peru", "South Africa", "India", "South Korea", "United Kingdom"] TEST_CODES = ["AUD", "THB", "RUB", "CNY", "JPY", "PEN", "ZAR", "INR", "KRW", "GBP"] describe Currencies do describe "#countries" do it "should list all supported countries" do countries = Currencies.countries countries.size.should == 112 TEST_COUNTRIES.each { |country| countries.should include(country) } end end describe "#currency_codes" do it "should list all supported country codes" do codes = Currencies.currency_codes codes.size.should == 112 TEST_CODES.each { |code| codes.should include(code) } end end describe "#for_country" do it "should return all information for the given country" do data = Currencies.for_country("Peru") data.should be_a(Hash) data.should include(:code) data[:code].should == "PEN" data.should include(:currency) data[:currency].should == "Nuevo Sol" data.should include(:symbol) data[:symbol].should == "S/." data.should_not include(:country) end end describe "#for_code" do it "should return all information for the given currency code" do data = Currencies.for_code("PEN") data.should be_a(Hash) data.should include(:country) data[:country].should == "Peru" data.should include(:currency) data[:currency].should == "Nuevo Sol" data.should include(:symbol) data[:symbol].should == "S/." data.should_not include(:code) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
twitter_cldr-1.0.0 | spec/shared/currencies_spec.rb |