diff --git a/lib/awesome_print/inspector.rb b/lib/awesome_print/inspector.rb index 4d0ee71..1193757 100644 --- a/lib/awesome_print/inspector.rb +++ b/lib/awesome_print/inspector.rb @@ -175,7 +175,7 @@ module AwesomePrint # Load ~/.aprc file with custom defaults that override default options. #------------------------------------------------------------------------------ def merge_custom_defaults! - dotfile = File.join(ENV["HOME"], ".aprc") + dotfile = File.join(ENV['HOME'], '.aprc') load dotfile if File.readable?(dotfile) merge_options!(AwesomePrint.defaults) if AwesomePrint.defaults.is_a?(Hash) rescue => e diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3b564bd..b9d65c2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -71,7 +71,8 @@ def normalize_object_id_strings(str, options) end def stub_dotfile! - dotfile = File.join(ENV["HOME"], ".aprc") + dotfile = File.join(ENV['HOME'], '.aprc') + allow(File).to receive(:readable?).and_call_original expect(File).to receive(:readable?).at_least(:once).with(dotfile).and_return(false) end