Sha256: ba5e4811631556d8747228030993186ee030049c8389bb4c62b30303548eae08

Contents?: true

Size: 1.05 KB

Versions: 16

Compression:

Stored size: 1.05 KB

Contents

require 'mccloud'
require 'fileutils'
require 'tempfile'
require 'mccloud/provider/aws/provider'

describe "AWS provider" do

  before(:each) do
   @tempdir = Dir.mktmpdir
   @env=Mccloud::Environment.new(:cwd => @tempdir,:autoload => false)
  end

  after(:each) do
    @env=nil
    FileUtils.remove_entry_secure @tempdir
  end

  it "When there are no credentials, accessing the raw provider should be missing credentials" do
    p=::Mccloud::Provider::Aws::Provider.new("aws-bla",{},@env)
    p.credentials_path=File.join(@tempdir,".fog")
    expect {
      raw=p.raw
    }.to raise_error(Mccloud::Error)
  end

  it "When there are credentials, accessing the raw provider should be ok" do
    p=::Mccloud::Provider::Aws::Provider.new("aws-bla",{},@env)
    credentials={:default => {:aws_access_key_id => "1223454",
                 :aws_secret_access_key => "123456"}}
    p.credentials_path=File.join(@tempdir,".fog")
    File.open(p.credentials_path,'w') {|f| f.write(credentials.to_yaml)}
    expect {
      raw=p.raw
    }.to_not raise_error(Mccloud::Error)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mccloud-0.1.1 spec/provider/aws/credentials_spec.rb
mccloud-0.0.28 spec/provider/aws/credentials_spec.rb
mccloud-0.0.27 spec/provider/aws/credentials_spec.rb
mccloud-0.0.26 spec/provider/aws/credentials_spec.rb
mccloud-0.0.25 spec/provider/aws/credentials_spec.rb
mccloud-0.0.24 spec/provider/aws/credentials_spec.rb
mccloud-0.0.23 spec/provider/aws/credentials_spec.rb
mccloud-0.0.22 spec/provider/aws/credentials_spec.rb
mccloud-0.0.21 spec/provider/aws/credentials_spec.rb
mccloud-0.0.20 spec/provider/aws/credentials_spec.rb
mccloud-0.0.19 spec/provider/aws/credentials_spec.rb
mccloud-0.0.18 spec/provider/aws/credentials_spec.rb
mccloud-0.0.17 spec/provider/aws/credentials_spec.rb
mccloud-0.0.16 spec/provider/aws/credentials_spec.rb
mccloud-0.0.15 spec/provider/aws/credentials_spec.rb
mccloud-0.0.14 spec/provider/aws/credentials_spec.rb