Sha256: cd737bd4ab27a3197e3e570e58ca8846ce4f3d183ecceb9d893084ced1266904

Contents?: true

Size: 886 Bytes

Versions: 3

Compression:

Stored size: 886 Bytes

Contents

describe 'timezone Country class' do
  context "when loaded via 'timezone'" do
    require 'tzinfo'
    describe 'existance' do
      subject { defined?(TZInfo) }

      it { is_expected.to be_truthy }
    end

    describe 'GB' do
      subject { ISO3166::Country.new('GB') }
      it 'should return the tzinfo country object' do
        expect(subject.timezones).to be_a(TZInfo::Country)
      end

      it 'should return the tzinfo country object' do
        expect(subject.timezones.zone_info).to be_a(Array)
      end

      it 'should return the tzinfo country object' do
        expect(subject.timezones.zone_identifiers).to eq ['Europe/London']
      end
    end

    describe 'US' do
      subject { ISO3166::Country.new('US') }
      it 'should return the tzinfo country object' do
        expect(subject.timezones.zone_identifiers.size).to eq 29
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
countries-2.0.0.rc spec/timezone_spec.rb
countries-2.0.0.pre.4 spec/timezone_spec.rb
countries-2.0.0.pre.3 spec/timezone_spec.rb