Sha256: 996e83f56e530aadec5c0a603170707d28200f8430e1258a55b3c02ecaf4df57

Contents?: true

Size: 646 Bytes

Versions: 4

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

require 'timezone/lookup/test'
require 'timezone'
require 'minitest/autorun'

class TestTest < ::Minitest::Test
  parallelize_me!

  def lookup
    Timezone::Lookup::Test.new(OpenStruct.new)
  end

  def test_simple_stub
    mine = lookup
    mine.stub(-10, 10, 'America/Los_Angeles')

    assert_equal 'America/Los_Angeles', mine.lookup(-10, 10)
  end

  def test_missing_stub
    assert_raises(::Timezone::Error::Test) do
      lookup.lookup(100, 100)
    end
  end

  def test_default_stub
    mine = lookup
    mine.default('America/Toronto')

    assert_equal 'America/Toronto', mine.lookup(-12, 12)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
timezone-1.2.12 test/timezone/lookup/test_test.rb
timezone-1.2.11 test/timezone/lookup/test_test.rb
timezone-1.2.10 test/timezone/lookup/test_test.rb
timezone-1.2.9 test/timezone/lookup/test_test.rb