diff options
-rw-r--r-- | lib/chef/formatters/error_description.rb | 7 | ||||
-rw-r--r-- | spec/unit/formatters/error_description_spec.rb | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/chef/formatters/error_description.rb b/lib/chef/formatters/error_description.rb index cbe8e964d8..ceb2f68539 100644 --- a/lib/chef/formatters/error_description.rb +++ b/lib/chef/formatters/error_description.rb @@ -17,8 +17,7 @@ # limitations under the License. # -require 'chef/version' - +require "chef/version" class Chef module Formatters @@ -68,7 +67,7 @@ class Chef end def error_context_info - context_info = {chef_version: Chef::VERSION} + context_info = { chef_version: Chef::VERSION } if Chef.node context_info[:platform] = Chef.node["platform"] context_info[:platform_version] = Chef.node["platform_version"] @@ -79,7 +78,7 @@ class Chef context_info[:program_name] = $PROGRAM_NAME # This is kind of wonky but it's the only way to get the entry path script. context_info[:executable] = File.realpath(caller.last[/^(.*):\d+:in /, 1]) - context_info.map {|k, v| "#{k}=#{v}"}.join("\n") + context_info.map { |k, v| "#{k}=#{v}" }.join("\n") end end diff --git a/spec/unit/formatters/error_description_spec.rb b/spec/unit/formatters/error_description_spec.rb index fd2b0334b0..cf6372ed49 100644 --- a/spec/unit/formatters/error_description_spec.rb +++ b/spec/unit/formatters/error_description_spec.rb @@ -53,13 +53,13 @@ describe Chef::Formatters::ErrorDescription do stub_const("RUBY_DESCRIPTION", "ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]") allow(subject).to receive(:caller) { Kernel.caller + ["/test/bin/chef-client:1:in `<main>'"] } allow(File).to receive(:realpath).and_call_original - allow(File).to receive(:realpath).with('/test/bin/chef-client').and_return('/test/bin/chef-client') + allow(File).to receive(:realpath).with("/test/bin/chef-client").and_return("/test/bin/chef-client") end around do |ex| old_program_name = $PROGRAM_NAME begin - $PROGRAM_NAME = 'chef-client' + $PROGRAM_NAME = "chef-client" ex.run ensure $PROGRAM_NAME = old_program_name @@ -117,7 +117,7 @@ executable=/test/bin/chef-client it "should output the expected sections" do # This can't be in a before block because the spec-wide helper calls a # reset on global values. - Chef.set_node({"platform" => "openvms", "platform_version" => "8.4-2L1"}) + Chef.set_node({ "platform" => "openvms", "platform_version" => "8.4-2L1" }) subject.display(out) expect(out.out.string).to eq <<-END ================================================================================ |