Sha256: e53c074d6b185025b23a6caa9e56645500cb2e7b31d24c9cea5531ace700a77a

Contents?: true

Size: 1.12 KB

Versions: 28

Compression:

Stored size: 1.12 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
      let(:custom_dir) { Dir.mktmpdir("custom") }

      it "returns a String of the expanded directory" do
        config_options = {
          :directory => custom_dir
        }
        config = Brightbox::BBConfig.new(config_options)

        expect(config.config_directory).to eql(custom_dir)
      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

28 entries across 28 versions & 1 rubygems

Version Path
brightbox-cli-3.3.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-3.2.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-3.1.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-3.0.1 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-3.0.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.12.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.11.2 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.11.1 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.11.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.10.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.9.3 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.9.2 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.9.1 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.9.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.8.2 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.8.1 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.8.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.7.1 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.7.0 spec/unit/brightbox/bb_config/config_directory_spec.rb
brightbox-cli-2.6.0 spec/unit/brightbox/bb_config/config_directory_spec.rb