Sha256: debd6f111e90ec691709f570879bb1462fd2686883aeab4cc48a693e066b0f1d

Contents?: true

Size: 1.81 KB

Versions: 3

Compression:

Stored size: 1.81 KB

Contents

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

module Propono
  class ConfigurationTest < Minitest::Test

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

    def test_obtaining_singletion
      refute Propono.config.nil?
    end

    def test_block_syntax
      test_key = "foobar-123-access"
      Propono.config do |config|
        config.access_key = test_key
      end
      assert_equal test_key, Propono.config.access_key
    end

    def test_access_key
      access_key = "test-access-key"
      Propono.config.access_key = access_key
      assert_equal access_key, Propono.config.access_key
    end

    def test_secret_key
      secret_key = "test-secret-key"
      Propono.config.secret_key = secret_key
      assert_equal secret_key, Propono.config.secret_key
    end

    def test_queue_region
      queue_region = "test-queue-region"
      Propono.config.queue_region = queue_region
      assert_equal queue_region, Propono.config.queue_region
    end

    def test_application_name
      application_name = "test-application-name"
      Propono.config.application_name = application_name
      assert_equal application_name, Propono.config.application_name
    end

    def test_missing_access_key_throws_exception
      assert_raises(ProponoConfigurationError) do
        Propono.config.access_key
      end
    end

    def test_missing_secret_key_throws_exception
      assert_raises(ProponoConfigurationError) do
        Propono.config.secret_key
      end
    end

    def test_missing_queue_region_throws_exception
      assert_raises(ProponoConfigurationError) do
        Propono.config.queue_region
      end
    end

    def test_missing_application_name_throws_exception
      assert_raises(ProponoConfigurationError) do
        Propono.config.application_name
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
propono-0.6.3 test/configuration_test.rb
propono-0.6.1 test/configuration_test.rb
propono-0.6.0 test/configuration_test.rb