Sha256: 25baa6e1772dbb11c5200fe971fddcf2aad3bd099521584f066153ad2a7b85a6

Contents?: true

Size: 1.05 KB

Versions: 18

Compression:

Stored size: 1.05 KB

Contents

require "spec_helper"

describe Brightbox::BBConfig do
  describe "#default_client" do
    context "when config file is empty" do
      before do
        remove_config
        @config = Brightbox::BBConfig.new
      end

      it "returns the configured default" do
        expect(@config.default_client).to be_nil
      end
    end

    context "when config file has no default" do
      before do
        contents = <<-EOS
        [core]
        EOS
        @tmp_config = config_from_contents(contents)
        @config = config_from_contents(contents)
      end

      it "returns the configured default" do
        expect(@config.default_client).to be_nil
      end
    end

    context "when config file contains a default client" do
      before do
        @client_name = "app-b3n5b"
        contents = <<-EOS
        [core]
        default_client = #{@client_name}
        EOS
        @config = config_from_contents(contents)
      end

      it "returns the configured default" do
        expect(@config.default_client).to eql(@client_name)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-5.0.0.rc2 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-5.0.0.rc1 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-5.0.0.alpha spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.8.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/bb_config/default_client_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/bb_config/default_client_spec.rb