Sha256: 8ead464618822ccec961ceace78774a81cb1ef621694eb95f5a5b5699e9cfef1

Contents?: true

Size: 1.12 KB

Versions: 64

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

require 'r10k/logging'
require 'r10k/action/deploy/deploy_helpers'

describe R10K::Action::Deploy::DeployHelpers do
  subject do
    Object.new.tap do |o|
      o.extend(R10K::Logging)
      o.extend(described_class)
    end
  end

  describe "checking for a config file" do
    it "logs a warning and exits when no config file was set" do
      logger = subject.logger

      expect(logger).to receive(:fatal).with("No configuration file given, no config file found in current directory, and no global config present")

      expect {
        subject.expect_config!
      }.to exit_with(8)
    end
  end

  describe "checking the write lock setting" do
    it "logs a warning and exits when the write lock is set" do
      logger = subject.logger

      expect(logger).to receive(:fatal).with("Making changes to deployed environments has been administratively disabled.")
      expect(logger).to receive(:fatal).with("Reason: r10k is sleepy and wants to take a nap")

      expect {
        subject.check_write_lock!(deploy: {write_lock: "r10k is sleepy and wants to take a nap"})
      }.to exit_with(16)
    end
  end
end

Version data entries

64 entries across 64 versions & 2 rubygems

Version Path
r10k-3.0.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.6.4 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.6.3 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.6.2 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.6.1 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.6.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.5.5 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.5.4 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.5.3 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.5.2 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.5.1 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.4.5 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.3.1 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.4.4 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.5.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.4.3 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.4.1 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.4.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.3.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.2.2 spec/unit/action/deploy/deploy_helpers_spec.rb