Sha256: 3cb58b1015ad21559a2996cf10b756530b9cf80c81fd1866d31e9e5e33730e60

Contents?: true

Size: 586 Bytes

Versions: 8

Compression:

Stored size: 586 Bytes

Contents

require 'timezone/lookup/basic'
require 'minitest/autorun'

class BasicLookupTest < ::Minitest::Test
  parallelize_me!

  def config
    @config ||= Struct.new(:protocol, :url).new('http', 'example.com')
  end

  def lookup
    ::Timezone::Lookup::Basic.new(config)
  end

  def test_missing_protocol
    config.protocol = nil
    assert_raises(::Timezone::Error::InvalidConfig) { lookup }
  end

  def test_missing_url
    config.url = nil
    assert_raises(::Timezone::Error::InvalidConfig) { lookup }
  end

  def test_initialization
    assert_equal lookup.config, config
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
timezone-1.2.4 test/timezone/lookup/test_basic.rb
timezone-1.2.3 test/timezone/lookup/test_basic.rb
timezone-1.2.2 test/timezone/lookup/test_basic.rb
timezone-1.2.1 test/timezone/lookup/test_basic.rb
timezone-1.2.0 test/timezone/lookup/test_basic.rb
timezone-1.1.1 test/timezone/lookup/test_basic.rb
timezone-1.1.0 test/timezone/lookup/test_basic.rb
timezone-1.0.0 test/timezone/lookup/test_basic.rb