Sha256: cb59a1d326ac87a3a68020ef73f9d4802563ef1d89c759ac850511ce0a040872

Contents?: true

Size: 570 Bytes

Versions: 6

Compression:

Stored size: 570 Bytes

Contents

require_relative '../../spec_helper'

module Barometer::Query
  describe Format::Postalcode do
    describe '.geo' do
      specify { expect( Format::Postalcode.geo(nil) ).to eq({country_code: 'CA'}) }
      specify { expect( Format::Postalcode.geo('ignored') ).to eq({country_code: 'CA'}) }
    end

    describe '.is?' do
      it 'recognizes a valid format' do
        expect( Format::Postalcode.is?('T5B 4M9') ).to be_true
      end

      it 'recognizes non-valid format' do
        expect( Format::Postalcode.is?('90210') ).to be_false
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
barometer-0.9.7 spec/query/formats/postalcode_spec.rb
barometer-0.9.6 spec/query/formats/postalcode_spec.rb
barometer-0.9.5 spec/query/formats/postalcode_spec.rb
barometer-0.9.4 spec/query/formats/postalcode_spec.rb
barometer-0.9.3 spec/query/formats/postalcode_spec.rb
barometer-0.9.2 spec/query/formats/postalcode_spec.rb