Sha256: e82a1d3713333c792555674beb078f13a175cb2ed5debed4d0692dff3511c381
Contents?: true
Size: 886 Bytes
Versions: 3
Compression:
Stored size: 886 Bytes
Contents
# frozen_string_literal: true require 'timezone/lookup/test' require 'timezone' require 'minitest/autorun' require 'ostruct' 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_simple_unstub mine = lookup mine.stub(-10, 10, nil) assert_nil mine.lookup(-10, 10) mine.unstub(-10, 10) assert_raises(::Timezone::Error::Test) do mine.lookup(-10, 10) end 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
timezone-1.3.28 | test/timezone/lookup/test_test.rb |
timezone-1.3.27 | test/timezone/lookup/test_test.rb |
timezone-1.3.26 | test/timezone/lookup/test_test.rb |