Sha256: 4508f28cc30b75414fda898dfbfcc1445c49ce3f3b407d77ce7e9d35b9335545

Contents?: true

Size: 890 Bytes

Versions: 7

Compression:

Stored size: 890 Bytes

Contents

require "spec_helper"

describe Brightbox::BBConfig do
  let(:config) { config_from_contents(contents) }
  let(:fog_config) { config.to_fog }

  describe "#to_fog" do
    context "when not configured" do
      let(:contents) { "" }

      it "raises an error" do
        expect {
          fog_config
        }.to raise_error(Brightbox::BBConfigError)
      end
    end

    context "when configured with API client" do
      let(:contents) { API_CLIENT_CONFIG_CONTENTS }

      it "doesn't includes the password" do
        expect(fog_config).to_not have_key(:brightbox_password)
      end
    end

    context "when configured with a User app" do
      let(:contents) { USER_APP_CONFIG_CONTENTS }

      it "includes the password" do
        pending "context is wrong to pass require values through"
        expect(fog_config).to have_key(:brightbox_password)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
brightbox-cli-1.2.2 spec/unit/brightbox/config/to_fog_spec.rb
brightbox-cli-1.2.1 spec/unit/brightbox/config/to_fog_spec.rb
brightbox-cli-1.2.0 spec/unit/brightbox/config/to_fog_spec.rb
brightbox-cli-1.1.0 spec/unit/brightbox/config/to_fog_spec.rb
brightbox-cli-1.0.0 spec/unit/brightbox/config/to_fog_spec.rb
brightbox-cli-1.0.0.rc2 spec/unit/brightbox/config/to_fog_spec.rb
brightbox-cli-1.0.0.rc1 spec/unit/brightbox/config/to_fog_spec.rb