Sha256: 57e609df84489e12bf700a423d6c7a01b299da7315f10cd969bd3f6234fca50f

Contents?: true

Size: 633 Bytes

Versions: 33

Compression:

Stored size: 633 Bytes

Contents

# frozen_string_literal: true

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

class BasicLookupTest < ::Minitest::Test
  parallelize_me!

  def config
    @config ||= OpenStruct.new(protocol: 'http', url: '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

33 entries across 33 versions & 1 rubygems

Version Path
timezone-1.3.8 test/timezone/lookup/test_basic.rb
timezone-1.3.7 test/timezone/lookup/test_basic.rb
timezone-1.3.6 test/timezone/lookup/test_basic.rb
timezone-1.3.5 test/timezone/lookup/test_basic.rb
timezone-1.3.4 test/timezone/lookup/test_basic.rb
timezone-1.3.3 test/timezone/lookup/test_basic.rb
timezone-1.3.2 test/timezone/lookup/test_basic.rb
timezone-1.3.1 test/timezone/lookup/test_basic.rb
timezone-1.3.0 test/timezone/lookup/test_basic.rb
timezone-1.2.12 test/timezone/lookup/test_basic.rb
timezone-1.2.11 test/timezone/lookup/test_basic.rb
timezone-1.2.10 test/timezone/lookup/test_basic.rb
timezone-1.2.9 test/timezone/lookup/test_basic.rb