Sha256: 8c402a1c837edef5cb33926628616802474e6f0d54d01a8c76fdfacbb5d14937

Contents?: true

Size: 929 Bytes

Versions: 3

Compression:

Stored size: 929 Bytes

Contents

require 'timezone/zone'
require 'minitest/autorun'

class TestZone < ::Minitest::Test
  parallelize_me!

  def la
    @la ||= Timezone::Zone.new('America/Los_Angeles')
  end

  def paris
    @paris ||= Timezone::Zone.new('Europe/Paris')
  end

  def test_name
    assert_equal 'America/Los_Angeles', la.name
    assert_equal 'Europe/Paris', paris.name
  end

  def test_valid?
    assert la.valid?
    assert paris.valid?
  end

  def test_to_s
    assert_equal 'America/Los_Angeles', la.to_s
    assert_equal 'Europe/Paris', paris.to_s
  end

  def test_inspect
    assert_equal(
      '#<Timezone::Zone name: "America/Los_Angeles">',
      la.inspect
    )

    assert_equal(
      '#<Timezone::Zone name: "Europe/Paris">',
      paris.inspect
    )
  end

  def test_comparable
    assert paris > la
    assert la < paris
    assert la == Timezone::Zone.new('America/Los_Angeles')

    assert_equal nil, paris <=> 8
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
timezone-0.99.2 test/timezone/test_zone.rb
timezone-0.99.1 test/timezone/test_zone.rb
timezone-0.99.0 test/timezone/test_zone.rb