summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Danna <steve@chef.io>2015-07-31 12:17:28 +0100
committerSteven Danna <steve@chef.io>2015-08-25 17:30:23 +0100
commitb1342d9bf65a6a59dfe1057fac7a1d7f758f1e99 (patch)
tree4b0568ca5c4ed9f7c34c77ee2838f84f20f36b43
parentb33bbd1e999969aa156077155f82dfcd2b3e580e (diff)
downloadchef-b1342d9bf65a6a59dfe1057fac7a1d7f758f1e99.tar.gz
Use stubbed home in tests rather than ENV['HOME']
I think this likely broke on rebase.
-rw-r--r--spec/unit/knife/core/subcommand_loader_spec.rb8
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