Sha256: 4fdcc6a6dd4da6fb859f032396f1ef67ed4cfe169389652e55cca2a5c270d98b

Contents?: true

Size: 841 Bytes

Versions: 1

Compression:

Stored size: 841 Bytes

Contents

require 'spec_helper'

describe Vcloud::Fog do
  describe "fog_credentials_pass" do
    let(:subject) { Vcloud::Fog::fog_credentials_pass }

    context "vcloud_director_password not set" do
      it "should return nil" do
        expect(::Fog).to receive(:credentials).and_return({})
        expect(subject).to eq(nil)
      end
    end

    context "vcloud_director_password set" do
      it "should return string" do
        expect(::Fog).to receive(:credentials).and_return({
          :vcloud_director_password => 'supersekret',
        })
        expect(subject).to eq('supersekret')
      end
    end

    context "Fog LoadError" do
      it "should suppress exception and return nil" do
        expect(::Fog).to receive(:credentials).and_raise(::Fog::Errors::LoadError)
        expect(subject).to eq(nil)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vcloud-core-0.7.0 spec/vcloud/fog_spec.rb