Sha256: 02f0d304fa748d1721b4bae5f55a89d03e93d76082ce4d0d67ae79ca23eaf407

Contents?: true

Size: 719 Bytes

Versions: 8

Compression:

Stored size: 719 Bytes

Contents

require 'timezone/loader'
require 'minitest/autorun'

module Timezone
  class TestLoader < ::Minitest::Test
    parallelize_me!

    def test_load
      assert_equal(
        [[1_483_228_800, 'GMT', false, 0]],
        Loader.load('GMT')
      )

      assert_raises ::Timezone::Error::InvalidZone do
        Loader.load('foo/bar')
      end
    end

    def test_names
      assert Loader.names.include?('GMT')
      assert Loader.names.include?('Europe/Paris')
      refute Loader.names.include?('foo/bar')
    end

    def test_valid?
      assert Loader.valid?('America/Los_Angeles')
      assert Loader.valid?('Europe/Paris')
      refute Loader.valid?('foo/bar')
      refute Loader.valid?(nil)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
timezone-1.2.8 test/timezone/test_loader.rb
timezone-1.2.7 test/timezone/test_loader.rb
timezone-1.2.6 test/timezone/test_loader.rb
timezone-1.2.5 test/timezone/test_loader.rb
timezone-1.2.4 test/timezone/test_loader.rb
timezone-1.2.3 test/timezone/test_loader.rb
timezone-1.2.2 test/timezone/test_loader.rb
timezone-1.2.1 test/timezone/test_loader.rb