Sha256: ba0cccdbfe4a81d047d01e6c1ae4e11b85f3edba4f74ae33f5e162db521f8c05

Contents?: true

Size: 1.48 KB

Versions: 12

Compression:

Stored size: 1.48 KB

Contents

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

module Propono
  class AwsConfigTest < Minitest::Test

    def setup
      @config = Propono::Configuration.new
      
      @config.access_key = "test-access-key"
      @config.secret_key = "test-secret-key"
      @config.queue_region = "test-queue-region"
      
      @aws_config = Propono::AwsConfig.new(@config)
    end

    def test_access_key
      assert_equal "test-access-key", @aws_config.aws_options[:aws_access_key_id]
    end
    
    def test_secret_key
      assert_equal "test-secret-key", @aws_config.aws_options[:aws_secret_access_key]
    end
    
    def test_region
      assert_equal "test-queue-region", @aws_config.aws_options[:region]
    end

    def test_no_iam_profile_selected
      assert ! @aws_config.aws_options.has_key?(:use_iam_profile)
    end
    
    def test_use_iam_profile
      @config.use_iam_profile = true
      assert @aws_config.aws_options[:use_iam_profile]
    end
    
    def test_selecting_use_iam_profile_results_in_no_access_key
      @config.use_iam_profile = true
      assert ! @aws_config.aws_options.has_key?(:aws_access_key_id)
    end
    
    def test_selecting_use_iam_profile_results_in_no_secret_key
      @config.use_iam_profile = true
      assert ! @aws_config.aws_options.has_key?(:aws_secret_access_key)
    end
    
    def test_region_when_using_iam_profile
      @config.use_iam_profile = true
      assert_equal "test-queue-region", @aws_config.aws_options[:region]
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
propono-1.3.0 test/components/aws_config_test.rb
propono-1.2.0 test/components/aws_config_test.rb
propono-1.1.3 test/components/aws_config_test.rb
propono-1.1.2 test/components/aws_config_test.rb
propono-1.1.1 test/components/aws_config_test.rb
propono-1.1.0 test/components/aws_config_test.rb
propono-1.0.0 test/components/aws_config_test.rb
propono-1.0.0.rc3 test/components/aws_config_test.rb
propono-1.0.0.rc2 test/components/aws_config_test.rb
propono-1.0.0.rc1 test/components/aws_config_test.rb
propono-0.11.1 test/components/aws_config_test.rb
propono-0.11.0 test/components/aws_config_test.rb