From 58c8b6f73098da98150dd4e671f8a9e34938f35a Mon Sep 17 00:00:00 2001
From: Graham Davison <g.m.davison@computer.org>
Date: Fri, 19 Jun 2020 00:14:16 -0700
Subject: [PATCH 1/3] Resolves linting errors

Signed-off-by: Graham Davison <g.m.davison@computer.org>
---
 .rubocop.yml                                                 | 5 +++++
 .../cookbooks/test/recipes/custom_repo_setup_recipe.rb       | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100644 .rubocop.yml

diff --git a/.rubocop.yml b/.rubocop.yml
new file mode 100644
index 0000000..526018a
--- /dev/null
+++ b/.rubocop.yml
@@ -0,0 +1,5 @@
+ChefDeprecations/LogResourceNotifications:
+  Exclude:
+    # The proposed replacement is available from Chef Infra Client 15.8.
+    # This cookbook supports 13.0 and up.
+    - 'test/fixtures/cookbooks/test/recipes/omnibus_service.rb'
diff --git a/test/fixtures/cookbooks/test/recipes/custom_repo_setup_recipe.rb b/test/fixtures/cookbooks/test/recipes/custom_repo_setup_recipe.rb
index ab4be61..6f0bc54 100644
--- a/test/fixtures/cookbooks/test/recipes/custom_repo_setup_recipe.rb
+++ b/test/fixtures/cookbooks/test/recipes/custom_repo_setup_recipe.rb
@@ -1,5 +1,5 @@
 # Configure a custom repository setup recipe
-node.normal['chef-ingredient']['custom-repo-recipe'] = 'custom_repo::awesome_custom_setup'
+node.default['chef-ingredient']['custom-repo-recipe'] = 'custom_repo::awesome_custom_setup'
 
 chef_ingredient 'chef-server' do
   action :install

From 358852e93926a76439ba068948b105ecba771e84 Mon Sep 17 00:00:00 2001
From: Graham Davison <g.m.davison@computer.org>
Date: Thu, 18 Jun 2020 22:39:37 -0700
Subject: [PATCH 2/3] Adds full path to `chef-automate` executable in guard
 condition

Signed-off-by: Graham Davison <g.m.davison@computer.org>
---
 resources/automatev2.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/resources/automatev2.rb b/resources/automatev2.rb
index 37c6228..41f57e9 100644
--- a/resources/automatev2.rb
+++ b/resources/automatev2.rb
@@ -45,7 +45,7 @@
   execute "/usr/local/bin/chef-automate deploy #{Chef::Config[:file_cache_path]}/config.toml#{' --accept-terms-and-mlsa' if new_resource.accept_license}" do
     cwd Chef::Config[:file_cache_path]
     only_if { FileTest.file?("#{Chef::Config[:file_cache_path]}/config.toml") }
-    not_if 'chef-automate service-versions'
+    not_if '/usr/local/bin/chef-automate service-versions'
   end
 
   file "#{Chef::Config[:file_cache_path]}/custom_config.toml" do

From 35b59fab2dba363909756aa5f4ae2d1abfd2d5c8 Mon Sep 17 00:00:00 2001
From: Graham Davison <g.m.davison@computer.org>
Date: Thu, 18 Jun 2020 22:40:22 -0700
Subject: [PATCH 3/3] Adds test for deletion of temporary installation and
 correct location of final installation

Signed-off-by: Graham Davison <g.m.davison@computer.org>
---
 .../chef_automatev2/test_chef_automatev2_spec.rb          | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/integration/chef_automatev2/test_chef_automatev2_spec.rb b/test/integration/chef_automatev2/test_chef_automatev2_spec.rb
index 5c939fd..eece52b 100644
--- a/test/integration/chef_automatev2/test_chef_automatev2_spec.rb
+++ b/test/integration/chef_automatev2/test_chef_automatev2_spec.rb
@@ -2,6 +2,14 @@
 #   its('exit_status') { should eq 0 }
 # end
 
+describe file('/usr/local/bin/chef-automate') do
+  it { should_not exist }
+end
+
+describe file('/usr/bin/chef-automate') do
+  it { should exist }
+end
+
 describe command('chef-automate version') do
   its('exit_status') { should eq 0 }
 end