Sha256: 015b5e39318561e0d0497cde881a35e465373712c70ec233993e908feb1d4053

Contents?: true

Size: 577 Bytes

Versions: 3

Compression:

Stored size: 577 Bytes

Contents

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

class BasicLookupTest < ::Minitest::Unit::TestCase
  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

3 entries across 3 versions & 1 rubygems

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