Sha256: b437a8e46e901be5175af0cb7ebe36b1fc7b8440f5984926bfd9258e0d587fd1

Contents?: true

Size: 1.5 KB

Versions: 10

Compression:

Stored size: 1.5 KB

Contents

require 'chef/provisioning/fog_driver/providers/aws/credentials'

describe Chef::Provisioning::FogDriver::Providers::AWS::Credentials do
  describe "#load_ini" do
    let(:aws_credentials_ini_file) { File.join(File.expand_path('../../../../support', __FILE__), 'aws/ini-file.ini') }

    before do
      described_class.load_ini(aws_credentials_ini_file)
    end

    it "should load a default profile" do
      expect(described_class['default']).to include(:aws_access_key_id)
    end

    it "should load the correct values" do
      expect(described_class['default'][:aws_access_key_id]).to eq "12345"
      expect(described_class['default'][:aws_secret_access_key]).to eq "abcde"
      expect(described_class['default'][:region]).to eq "us-east-1"
      expect(described_class['default'][:aws_session_token]).to eq "mysecret"
    end

    it "should load several profiles" do
      expect(described_class.keys.length).to eq 2
    end
  end

  describe "#load_csv" do
    let(:aws_credentials_csv_file) { File.join(File.expand_path('../../../../support', __FILE__), 'aws/config-file.csv') }
    before do
      described_class.load_csv(aws_credentials_csv_file)
    end

    it "should load a single profile" do
      expect(described_class['default']).to include(:aws_access_key_id)
    end

    it "should load the correct values" do
      expect(described_class['default'][:aws_access_key_id]).to eq "12345"
    end

    it "should load several profiles" do
      expect(described_class.keys.length).to eq 2
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
chef-provisioning-fog-0.15.3 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.15.2 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.15.1 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.14.0 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.13.2 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.13.1 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.13 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.12 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.11 spec/unit/providers/aws/credentials_spec.rb
chef-provisioning-fog-0.10 spec/unit/providers/aws/credentials_spec.rb