Sha256: c668ba1f94d63f23911ff8b37b6e7fee8de467d37933966a2d0e03d76f93d764

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

require_relative 'test_helper'

module MeducationSDK
  class ConfigurationTest < Minitest::Test

    def setup
      super
      MeducationSDK.instance_variable_set("@config", nil)
    end

    def test_obtaining_singletion
      refute MeducationSDK.config.nil?
    end

    def test_block_syntax
      test_key = "foobar-123-access"
      MeducationSDK.config do |config|
        config.access_id = test_key
      end
      assert_equal test_key, Loquor.config.access_id
    end

    def test_endpoint_is_set_correctly
      Configuration.new
      assert_equal "http://www.meducation.net/system", Loquor.config.endpoint
    end

    def test_endpoint_is_set_correctly
      Configuration.new
      assert_equal true, Loquor.config.retry_404s
    end

    def test_access_id_proxies_to_loquor
      access_id = "test-access-id"
      MeducationSDK.config.access_id = access_id
      assert_equal access_id, Loquor.config.access_id
    end

    def test_secret_key_proxies_to_loquor
      key = "test-secret-key"
      MeducationSDK.config.secret_key = key
      assert_equal key, Loquor.config.secret_key
    end

    def test_cache_proxies_to_loquor
      cache = mock()
      MeducationSDK.config.cache = cache
      assert_equal cache, Loquor.config.cache
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
meducation_sdk-1.5.7 test/configuration_test.rb
meducation_sdk-1.5.6 test/configuration_test.rb