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.28 test/timezone/lookup/test_basic.rb
timezone-1.3.27 test/timezone/lookup/test_basic.rb
timezone-1.3.26 test/timezone/lookup/test_basic.rb
timezone-1.3.25 test/timezone/lookup/test_basic.rb
timezone-1.3.24 test/timezone/lookup/test_basic.rb
timezone-1.3.23 test/timezone/lookup/test_basic.rb
timezone-1.3.22 test/timezone/lookup/test_basic.rb
timezone-1.3.21 test/timezone/lookup/test_basic.rb
timezone-1.3.20 test/timezone/lookup/test_basic.rb
timezone-1.3.19 test/timezone/lookup/test_basic.rb
timezone-1.3.18 test/timezone/lookup/test_basic.rb
timezone-1.3.17 test/timezone/lookup/test_basic.rb
timezone-1.3.16 test/timezone/lookup/test_basic.rb
timezone-1.3.15 test/timezone/lookup/test_basic.rb
timezone-1.3.14 test/timezone/lookup/test_basic.rb
timezone-1.3.13 test/timezone/lookup/test_basic.rb
timezone-1.3.12 test/timezone/lookup/test_basic.rb
timezone-1.3.11 test/timezone/lookup/test_basic.rb
timezone-1.3.10 test/timezone/lookup/test_basic.rb
timezone-1.3.9 test/timezone/lookup/test_basic.rb