diff options
Diffstat (limited to 'spec')
-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 |