File: timezone_spec.rb

package info (click to toggle)
ruby-countries 8.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,268 kB
  • sloc: ruby: 2,687; makefile: 4
file content (34 lines) | stat: -rw-r--r-- 917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# frozen_string_literal: true

describe 'timezone Country class' do
  context "when loaded via 'timezone'" do
    require 'tzinfo'
    describe 'existence' 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