Sha256: f316261dfc107f76b4a7c545c410b1879e4cd0c7611fa1486af59145a7eff9bf

Contents?: true

Size: 1.24 KB

Versions: 28

Compression:

Stored size: 1.24 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://spi.meducation.net", Loquor.config.endpoint
    end

    def test_retry_404s_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

28 entries across 28 versions & 1 rubygems

Version Path
meducation_sdk-2.2.2 test/configuration_test.rb
meducation_sdk-2.2.1 test/configuration_test.rb
meducation_sdk-2.2.0 test/configuration_test.rb
meducation_sdk-2.1.4 test/configuration_test.rb
meducation_sdk-2.1.3 test/configuration_test.rb
meducation_sdk-2.1.2 test/configuration_test.rb
meducation_sdk-2.1.1 test/configuration_test.rb
meducation_sdk-2.1.0 test/configuration_test.rb
meducation_sdk-2.0.5 test/configuration_test.rb
meducation_sdk-2.0.4 test/configuration_test.rb
meducation_sdk-2.0.3 test/configuration_test.rb
meducation_sdk-2.0.2 test/configuration_test.rb
meducation_sdk-2.0.1 test/configuration_test.rb
meducation_sdk-2.0.0 test/configuration_test.rb
meducation_sdk-1.6.16 test/configuration_test.rb
meducation_sdk-1.6.15 test/configuration_test.rb
meducation_sdk-1.6.14 test/configuration_test.rb
meducation_sdk-1.6.13 test/configuration_test.rb
meducation_sdk-1.6.12 test/configuration_test.rb
meducation_sdk-1.6.11 test/configuration_test.rb