diff options
author | unknown <cdoherty@chef.io> | 2016-02-24 11:49:31 -0800 |
---|---|---|
committer | unknown <cdoherty@chef.io> | 2016-02-24 14:02:48 -0800 |
commit | 768ca5bcb0e5074528f9cd41d303590256b89ec6 (patch) | |
tree | 510c95dcc0f5ffa4822f40b8af5d5a5e831b66bf | |
parent | 8bfde4491d53696d2242c4a0d52ccf6cf082f16c (diff) | |
download | chef-768ca5bcb0e5074528f9cd41d303590256b89ec6.tar.gz |
Fix unit spec for choco_exe.
-rw-r--r-- | spec/unit/provider/package/chocolatey_spec.rb | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb index a347aa7ebd..02414a3a96 100644 --- a/spec/unit/provider/package/chocolatey_spec.rb +++ b/spec/unit/provider/package/chocolatey_spec.rb @@ -462,17 +462,6 @@ munin-node|1.6.1.20130823 expect(new_resource).to be_updated_by_last_action end end - - describe "#choco_exe" do - it "calls #choco_install_path" do - # un-stub #choco_exe from the before{} block. - allow(provider).to receive(:choco_exe).and_call_original - expect(provider).to receive(:choco_install_path).and_return("spork") - provider.instance_variable_set("@choco_exe", nil) - - expect(provider.send(:choco_exe)).to match(%r{spork[/\\]bin[/\\]choco.exe}) - end - end end describe "behavior when Chocolatey is not installed" do @@ -493,12 +482,9 @@ describe "behavior when Chocolatey is not installed" do allow(provider).to receive(:shell_out!).and_return(double(:stdout => "")) } - context "#define_resource_requirements" do + context "#choco_exe" do it "triggers a MissingLibrary exception when Chocolatey is not installed" do - provider.action = :install - provider.load_current_resource - provider.define_resource_requirements - expect { provider.process_resource_requirements }.to raise_error(Chef::Exceptions::MissingLibrary, /Could not locate.*install.*cookbook.*PowerShell.*GetEnvironmentVariable/m) + expect { provider.send(:choco_exe) }.to raise_error(Chef::Exceptions::MissingLibrary, /Could not locate.*install.*cookbook.*PowerShell.*GetEnvironmentVariable/m) end end end |