Sha256: 6202aa8976fc35bd8756ac09e831eebd0d1fbe892e0278a9f54cd037953a3ba0

Contents?: true

Size: 1.1 KB

Versions: 19

Compression:

Stored size: 1.1 KB

Contents

require "spec_helper"

describe Brightbox::BBConfig do

  describe "#config_directory" do
    context "when default location is used" do
      it "returns a String of the users `.brightbox` directory" do
        config = Brightbox::BBConfig.new

        expanded_path = File.expand_path("~/.brightbox")
        expect(config.config_directory).to eql(expanded_path)
      end
    end

    context "when absolute custom location is set" do
      it "returns a String of the expanded directory" do
        config_options = {
          :directory => "/etc/local/brightbox_cli"
        }
        config = Brightbox::BBConfig.new(config_options)

        expect(config.config_directory).to eql("/etc/local/brightbox_cli")
      end
    end

    context "when custom config location is set" do
      it "returns a String of the expanded directory" do
        config_options = {
          :directory => "~/.cli_config"
        }
        config = Brightbox::BBConfig.new(config_options)

        expanded_path = File.expand_path("~/.cli_config")
        expect(config.config_directory).to eql(expanded_path)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
brightbox-cli-2.2.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.1.2 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.1.1 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.1.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.0.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.6.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.5.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.4.3 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.4.2 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.4.1 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.4.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.3.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.2.2 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.2.1 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.2.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.1.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.0.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.0.0.rc2 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-1.0.0.rc1 spec/unit/brightbox/bb_config/config_directory_spec.rb