Sha256: dbf2ef1352c253b61052d0d365f67dea56a08f3dd89c9a5f0b907a83c4ff6cf0

Contents?: true

Size: 886 Bytes

Versions: 18

Compression:

Stored size: 886 Bytes

Contents

require "spec_helper"

describe Brightbox::BBConfig do
  describe "#save_default_account" do
    context "when setting has not changed" do
      let(:account_id) { "acc-12345" }
      let(:config) do
        <<-EOS
        [core]
        default_client=cli-15243
        [cli-15243]
        default_account=#{account_id}
        EOS
      end

      before do
        @config = config_from_contents(config)
      end

      it "does not dirty the config" do
        @config.save_default_account(account_id)
        expect(@config).to_not be_dirty
      end
    end

    context "when setting has changed" do
      let(:account_id) { "acc-54321" }

      before do
        @config = config_from_contents(USER_APP_CONFIG_CONTENTS)
      end

      it "dirties the config" do
        @config.save_default_account(account_id)
        expect(@config).to be_dirty
      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/save_default_account_spec.rb
brightbox-cli-5.0.0.rc2 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-5.0.0.rc1 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-5.0.0.alpha spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.8.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/bb_config/save_default_account_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/bb_config/save_default_account_spec.rb