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.27 test/timezone/test_loader.rb
timezone-1.3.26 test/timezone/test_loader.rb
timezone-1.3.25 test/timezone/test_loader.rb
timezone-1.3.24 test/timezone/test_loader.rb
timezone-1.3.23 test/timezone/test_loader.rb
timezone-1.3.22 test/timezone/test_loader.rb
timezone-1.3.21 test/timezone/test_loader.rb
timezone-1.3.20 test/timezone/test_loader.rb
timezone-1.3.19 test/timezone/test_loader.rb
timezone-1.3.18 test/timezone/test_loader.rb
timezone-1.3.17 test/timezone/test_loader.rb
timezone-1.3.16 test/timezone/test_loader.rb
timezone-1.3.15 test/timezone/test_loader.rb
timezone-1.3.14 test/timezone/test_loader.rb
timezone-1.3.13 test/timezone/test_loader.rb
timezone-1.3.12 test/timezone/test_loader.rb
timezone-1.3.11 test/timezone/test_loader.rb
timezone-1.3.10 test/timezone/test_loader.rb
timezone-1.3.9 test/timezone/test_loader.rb
timezone-1.3.8 test/timezone/test_loader.rb