Sha256: a481aeded95f062598c894ac469e9c485953e6b334c202459aff457fd66212ea

Contents?: true

Size: 738 Bytes

Versions: 28

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true

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

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

    def test_load
      assert_equal(
        [[0, '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

28 entries across 28 versions & 1 rubygems

Version Path
timezone-1.3.7 test/timezone/test_loader.rb
timezone-1.3.6 test/timezone/test_loader.rb
timezone-1.3.5 test/timezone/test_loader.rb
timezone-1.3.4 test/timezone/test_loader.rb
timezone-1.3.3 test/timezone/test_loader.rb
timezone-1.3.2 test/timezone/test_loader.rb
timezone-1.3.1 test/timezone/test_loader.rb
timezone-1.3.0 test/timezone/test_loader.rb