Sha256: 81168e4d1dcc4510cfe1997cfad78c7d71009517ec3b6ec134083549c6e53ab7
Contents?: true
Size: 1.6 KB
Versions: 1
Compression:
Stored size: 1.6 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe "ZipCodeInfo" do describe "Positive Test Cases: " do it "should find the right city" do zip = ZipCodeInfo.instance.scf_city_for "99100" zip.should eql "Spokane" end it "should find the right state" do zip = ZipCodeInfo.instance.state_for "99100" zip.should eql "WA" end it "should find the right city when the zip is an integer" do zip = ZipCodeInfo.instance.scf_city_for 60699 ZipCodeInfo.instance.code.should eql "60699" zip.should eql "Chicago" end it "should find the right state when the zip is an integer" do zip = ZipCodeInfo.instance.state_for 60699 ZipCodeInfo.instance.code.should eql "60699" zip.should eql "IL" end it "should find the right city name when the city name contains an &" do zip = ZipCodeInfo.instance.scf_city_for "11099" zip.should eql "Queens &West Nassau" end end describe "Negative Test Cases: " do it "should handle no zip code" do zip = ZipCodeInfo.instance.scf_city_for zip.should be_false end it "should handle an invalid zip code - too long" do zip = ZipCodeInfo.instance.scf_city_for("123456") zip.should be_false end it "should handle an invalid zip code - too short" do zip = ZipCodeInfo.instance.scf_city_for "1234" zip.should be_false end it "should handle an invalid zip code - alphanum" do zip = ZipCodeInfo.instance.scf_city_for "1a23g" zip.should be_false end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
zip-code-info-0.1.0 | spec/zip-code-info_spec.rb |