spec/query/formats/zipcode_spec.rb in barometer-0.9.1 vs spec/query/formats/zipcode_spec.rb in barometer-0.9.2

- old
+ new

@@ -1,18 +1,20 @@ require_relative '../../spec_helper' -describe Barometer::Query::Format::Zipcode do - it ".country_code" do - Barometer::Query::Format::Zipcode.country_code(nil).should == "US" - Barometer::Query::Format::Zipcode.country_code("ignored").should == "US" - end - - describe ".is?" do - it "recognizes a valid format" do - Barometer::Query::Format::Zipcode.is?("90210-5555").should be_true +module Barometer::Query + describe Format::Zipcode do + describe '.geo' do + specify { expect( Format::Zipcode.geo(nil) ).to eq({country_code: 'US'}) } + specify { expect( Format::Zipcode.geo('ignored') ).to eq({country_code: 'US'}) } end - it "recognizes non-valid format" do - Barometer::Query::Format::Zipcode.is?("invalid").should be_false + describe '.is?' do + it 'recognizes a valid format' do + expect( Format::Zipcode.is?('90210-5555') ).to be_true + end + + it 'recognizes non-valid format' do + expect( Format::Zipcode.is?('invalid') ).to be_false + end end end end