spec/gman/identifier_spec.rb in gman-7.0.3 vs spec/gman/identifier_spec.rb in gman-7.0.4

- old
+ new

@@ -1,11 +1,12 @@ # frozen_string_literal: true RSpec.describe 'Gman identifier' do - let(:domain) { '' } subject { Gman.new(domain) } + let(:domain) { '' } + it 'parses the dotgov list' do expect(Gman.dotgov_list).to be_a(CSV::Table) expect(Gman.dotgov_list.first).to have_key('Domain Name') end @@ -13,78 +14,78 @@ context 'a state domain' do let(:domain) { 'state.ak.us' } it "knows it's a state" do expect(subject).to be_a_state - expect(subject.type).to eql(:state) + expect(subject.type).to be(:state) end it 'knows the state' do expect(subject.state).to eql('AK') end it "knows it's not a dotgov" do - expect(subject).to_not be_a_dotgov + expect(subject).not_to be_a_dotgov end it "know's it's not a city" do - expect(subject).to_not be_a_city + expect(subject).not_to be_a_city end it "know's it's not a county" do - expect(subject).to_not be_a_county + expect(subject).not_to be_a_county end end context 'a city domain' do let(:domain) { 'ci.champaign.il.us' } it "knows it's a city" do expect(subject).to be_a_city - expect(subject.type).to eql(:city) + expect(subject.type).to be(:city) end it 'knows the state' do expect(subject.state).to eql('IL') end it "knows it's not a dotgov" do - expect(subject).to_not be_a_dotgov + expect(subject).not_to be_a_dotgov end it "know's it's not a state" do - expect(subject).to_not be_a_state + expect(subject).not_to be_a_state end it "know's it's not a county" do - expect(subject).to_not be_a_county + expect(subject).not_to be_a_county end end context 'dotgovs' do context 'A federal dotgov' do let(:domain) { 'whitehouse.gov' } it "knows it's federal" do expect(subject).to be_federal - expect(subject.type).to eql(:federal) + expect(subject.type).to be(:federal) end it "knows it's a dotgov" do expect(subject).to be_a_dotgov end it "knows it's not a city" do - expect(subject).to_not be_a_city + expect(subject).not_to be_a_city end it "knows it's not a state" do - expect(subject).to_not be_a_state + expect(subject).not_to be_a_state end it "knows it's not a county" do - expect(subject).to_not be_a_county + expect(subject).not_to be_a_county end it 'knows the state' do expect(subject.state).to eql('DC') end @@ -105,27 +106,27 @@ context 'a state .gov' do let(:domain) { 'illinois.gov' } it "knows it's a state" do expect(subject).to be_a_state - expect(subject.type).to eql(:state) + expect(subject.type).to be(:state) end it "knows it's a dotgov" do expect(subject).to be_a_dotgov end it "knows it's not a city" do - expect(subject).to_not be_a_city + expect(subject).not_to be_a_city end it "knows it's not federal" do - expect(subject).to_not be_federal + expect(subject).not_to be_federal end it "knows it's not a county" do - expect(subject).to_not be_a_county + expect(subject).not_to be_a_county end it 'knows the state' do expect(subject.state).to eql('IL') end @@ -138,27 +139,27 @@ context 'a county .gov' do let(:domain) { 'ALLEGHENYCOUNTYPA.GOV' } it "knows it's a county" do expect(subject).to be_a_county - expect(subject.type).to eql(:county) + expect(subject.type).to be(:county) end it "knows it's a dotgov" do expect(subject).to be_a_dotgov end it "knows it's not a city" do - expect(subject).to_not be_a_city + expect(subject).not_to be_a_city end it "knows it's not federal" do - expect(subject).to_not be_federal + expect(subject).not_to be_federal end it "knows it's not a state" do - expect(subject).to_not be_a_state + expect(subject).not_to be_a_state end it 'knows the state' do expect(subject.state).to eql('PA') end @@ -171,11 +172,11 @@ context 'a city .gov' do let(:domain) { 'ABERDEENMD.GOV' } it "knows it's a city" do expect(subject).to be_a_city - expect(subject.type).to eql(:city) + expect(subject.type).to be(:city) end it 'knows the city' do expect(subject.city).to eql('Aberdeen') end @@ -187,14 +188,14 @@ it "knows it's a dotgov" do expect(subject).to be_a_dotgov end it "know's it's not a state" do - expect(subject).to_not be_a_state + expect(subject).not_to be_a_state end it "know's it's not a county" do - expect(subject).to_not be_a_county + expect(subject).not_to be_a_county end end end end