diff options
-rw-r--r-- | spec/unit/knife/core/subcommand_loader_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/unit/knife/core/subcommand_loader_spec.rb b/spec/unit/knife/core/subcommand_loader_spec.rb index 6c8e7486d9..126a5bd013 100644 --- a/spec/unit/knife/core/subcommand_loader_spec.rb +++ b/spec/unit/knife/core/subcommand_loader_spec.rb @@ -36,23 +36,23 @@ describe Chef::Knife::SubcommandLoader do describe "#for_config" do context "when ~/.chef/plugin_manifest.json exists" do before do - allow(File).to receive(:exist?).with(File.join(ENV['HOME'], '.chef', 'plugin_manifest.json')).and_return(true) + allow(File).to receive(:exist?).with(File.join(home, '.chef', 'plugin_manifest.json')).and_return(true) end it "creates a HashedCommandLoader with the manifest has _autogenerated_command_paths" do - allow(File).to receive(:read).with(File.join(ENV['HOME'], '.chef', 'plugin_manifest.json')).and_return("{ \"_autogenerated_command_paths\": {}}") + allow(File).to receive(:read).with(File.join(home, '.chef', 'plugin_manifest.json')).and_return("{ \"_autogenerated_command_paths\": {}}") expect(Chef::Knife::SubcommandLoader.for_config(config_dir)).to be_a Chef::Knife::SubcommandLoader::HashedCommandLoader end it "creates a CustomManifestLoader with then manifest has a key other than _autogenerated_command_paths" do - allow(File).to receive(:read).with(File.join(ENV['HOME'], '.chef', 'plugin_manifest.json')).and_return("{ \"plugins\": {}}") + allow(File).to receive(:read).with(File.join(home, '.chef', 'plugin_manifest.json')).and_return("{ \"plugins\": {}}") expect(Chef::Knife::SubcommandLoader.for_config(config_dir)).to be_a Chef::Knife::SubcommandLoader::CustomManifestLoader end end context "when ~/.chef/plugin_manifest.json does not exist" do before do - allow(File).to receive(:exist?).with(File.join(ENV['HOME'], '.chef', 'plugin_manifest.json')).and_return(false) + allow(File).to receive(:exist?).with(File.join(home, '.chef', 'plugin_manifest.json')).and_return(false) end it "creates a GemGlobLoader" do |