Sha256: 237e7428226b7be64cc3dee0c11f2c376c44975304245f728c99ba690b71e2a0

Contents?: true

Size: 575 Bytes

Versions: 8

Compression:

Stored size: 575 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

8 entries across 8 versions & 1 rubygems

Version Path
timezone-0.6.0 test/basic_lookup_test.rb
timezone-0.5.0 test/basic_lookup_test.rb
timezone-0.4.3 test/basic_lookup_test.rb
timezone-0.4.2 test/basic_lookup_test.rb
timezone-0.4.1 test/basic_lookup_test.rb
timezone-0.4.0 test/basic_lookup_test.rb
timezone-0.3.11 test/basic_lookup_test.rb
timezone-0.3.10 test/basic_lookup_test.rb