Sha256: bae33cbe47a2fe4af822c22d9cc8b0fe7f3a281a625ae6d546e860177e2c0d6a

Contents?: true

Size: 1.15 KB

Versions: 30

Compression:

Stored size: 1.15 KB

Contents

require File.expand_path('../test_helper', __FILE__)

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_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

30 entries across 30 versions & 1 rubygems

Version Path
meducation_sdk-0.10.0 test/configuration_test.rb
meducation_sdk-0.9.0 test/configuration_test.rb
meducation_sdk-0.8.0 test/configuration_test.rb
meducation_sdk-0.7.0 test/configuration_test.rb
meducation_sdk-0.6.1 test/configuration_test.rb
meducation_sdk-0.6.0 test/configuration_test.rb
meducation_sdk-0.5.0 test/configuration_test.rb
meducation_sdk-0.4.1 test/configuration_test.rb
meducation_sdk-0.4.0 test/configuration_test.rb
meducation_sdk-0.3.4 test/configuration_test.rb