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.15.0 spec/unit/action/deploy/deploy_helpers_spec.rb
akerl-r10k-3.14.2.1 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.14.2 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.14.1 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.14.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.13.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.12.1 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.12.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.11.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.10.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.9.3 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.9.2 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.9.1 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.9.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.8.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.7.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.6.0 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-2.6.9 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.5.2 spec/unit/action/deploy/deploy_helpers_spec.rb
r10k-3.5.1 spec/unit/action/deploy/deploy_helpers_spec.rb