spec/unit/command/provision_spec.rb in chef-dk-3.3.23 vs spec/unit/command/provision_spec.rb in chef-dk-3.4.38
- old
+ new
@@ -282,13 +282,13 @@
it "disables policyfile integration" do
expect(command.enable_policyfile?).to be(false)
end
it "generates chef config with no policyfile options" do
- expected_config = <<-CONFIG
-# SSL Settings:
-ssl_verify_mode :verify_peer
+ expected_config = <<~CONFIG
+ # SSL Settings:
+ ssl_verify_mode :verify_peer
CONFIG
expect(context.chef_config).to eq(expected_config)
end
@@ -301,13 +301,13 @@
let(:policy_data) { { "name" => "myapp" } }
before do
allow(chef_config_loader).to receive(:load)
- allow(ChefDK::PolicyfileServices::Push).to receive(:new).
- with(policyfile: given_policyfile_path, ui: ui, policy_group: given_policy_group, config: chef_config, root_dir: Dir.pwd).
- and_return(push_service)
+ allow(ChefDK::PolicyfileServices::Push).to receive(:new)
+ .with(policyfile: given_policyfile_path, ui: ui, policy_group: given_policy_group, config: chef_config, root_dir: Dir.pwd)
+ .and_return(push_service)
allow(push_service).to receive(:policy_data).and_return(policy_data)
command.apply_params!(params)
command.setup_context
@@ -356,20 +356,20 @@
expect(command.policy_name).to eq("myapp")
expect(context.policy_name).to eq("myapp")
end
it "generates chef config with policyfile options" do
- expected_config = <<-CONFIG
-# SSL Settings:
-ssl_verify_mode :verify_peer
+ expected_config = <<~CONFIG
+ # SSL Settings:
+ ssl_verify_mode :verify_peer
-# Policyfile Settings:
-use_policyfile true
-policy_document_native_api true
+ # Policyfile Settings:
+ use_policyfile true
+ policy_document_native_api true
-policy_group "some-policy-group"
-policy_name "myapp"
+ policy_group "some-policy-group"
+ policy_name "myapp"
CONFIG
expect(context.chef_config).to eq(expected_config)
end
@@ -403,20 +403,20 @@
expect(command.policy_name).to eq("myapp")
expect(context.policy_name).to eq("myapp")
end
it "generates chef config with policyfile options" do
- expected_config = <<-CONFIG
-# SSL Settings:
-ssl_verify_mode :verify_peer
+ expected_config = <<~CONFIG
+ # SSL Settings:
+ ssl_verify_mode :verify_peer
-# Policyfile Settings:
-use_policyfile true
-policy_document_native_api true
+ # Policyfile Settings:
+ use_policyfile true
+ policy_document_native_api true
-policy_group "some-policy-group"
-policy_name "myapp"
+ policy_group "some-policy-group"
+ policy_name "myapp"
CONFIG
expect(context.chef_config).to eq(expected_config)
end
@@ -491,12 +491,12 @@
expect(push_service).to receive(:run).and_raise(exception)
end
it "prints an error and exits non-zero" do
- expected_output = <<-E
-Error: push failed
-Reason: (StandardError) some operation failed
+ expected_output = <<~E
+ Error: push failed
+ Reason: (StandardError) some operation failed
E
expect(command.run(params)).to eq(1)
expect(ui.output).to include(expected_output)
end