diff --git a/Gemfile b/Gemfile index 15bb0d62..62255bd8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'kafo', '~> 4.0' +gem 'kafo', '~> 4.1' gem 'librarian-puppet' gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '~> 6.0' if RUBY_VERSION < '2.1' diff --git a/hooks/boot/01-kafo-hook-extensions.rb b/hooks/boot/01-kafo-hook-extensions.rb index 98989b6b..fc752732 100644 --- a/hooks/boot/01-kafo-hook-extensions.rb +++ b/hooks/boot/01-kafo-hook-extensions.rb @@ -33,7 +33,7 @@ def ensure_packages(packages, state = 'installed') def apply_puppet_code(code) bin_path = Kafo::PuppetCommand.search_puppet_path('puppet') - Open3.capture3("echo \"#{code}\" | #{bin_path} apply --detailed-exitcodes") + Open3.capture3(*Kafo::PuppetCommand.format_command("echo \"#{code}\" | #{bin_path} apply --detailed-exitcodes")) end def fail_and_exit(message, code = 1) diff --git a/spec/hook_context_spec.rb b/spec/hook_context_spec.rb index e0102a8e..9d2d77b2 100644 --- a/spec/hook_context_spec.rb +++ b/spec/hook_context_spec.rb @@ -120,7 +120,7 @@ end after do - expect(Kafo::PuppetCommand).to have_received(:search_puppet_path) + expect(Kafo::PuppetCommand).to have_received(:search_puppet_path).twice end context 'empty code' do @@ -128,7 +128,7 @@ specify do is_expected.to eq('result') - expect(Open3).to have_received(:capture3).with('echo "" | /bin/puppet apply --detailed-exitcodes') + expect(Open3).to have_received(:capture3).with(anything, 'echo "" | /bin/puppet apply --detailed-exitcodes', anything) end end @@ -137,7 +137,7 @@ specify do is_expected.to eq('result') - expect(Open3).to have_received(:capture3).with('echo "package { \'vim-enhanced\': ensure => installed }" | /bin/puppet apply --detailed-exitcodes') + expect(Open3).to have_received(:capture3).with(anything, 'echo "package { \'vim-enhanced\': ensure => installed }" | /bin/puppet apply --detailed-exitcodes', anything) end end end