Sha256: 11d241d78ce588cf56404349fc66baa39f1a904c32d7c1c6eb8f89a64941d916
Contents?: true
Size: 960 Bytes
Versions: 1
Compression:
Stored size: 960 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') RSpec.describe GovKit::CA::PostalCode::Strategy::NDPCa do describe '#electoral_districts' do it 'should return the electoral districts within a postal code' do { 'G0C2Y0' => [24026], 'T5S2B9' => [48020, 48031], # too many 48031 'B0J2L0' => [12002], # too few 'K0A1K0' => [35031, 35076, 35088], }.each do |postal_code,electoral_districts| expect(GovKit::CA::PostalCode::Strategy::NDPCa.new(postal_code).electoral_districts).to eq(electoral_districts) end end it 'should return false if a postal code contains no electoral districts' do expect(GovKit::CA::PostalCode::Strategy::NDPCa.new('H0H0H0').electoral_districts).to eq(false) end it 'should return false if a postal code does not exist' do expect(GovKit::CA::PostalCode::Strategy::NDPCa.new('X1B1B1').electoral_districts).to eq(false) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
govkit-ca-0.0.12 | spec/ndp_ca_spec.rb |