diff options
author | tyler-ball <tyleraball@gmail.com> | 2015-02-13 15:01:15 -0800 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2015-02-13 15:01:15 -0800 |
commit | 89c76b52e2c2d7c113783451f84a68d91711c4d1 (patch) | |
tree | 259c8056cd5f9ae30e4e474a080d12f9dbd523fb | |
parent | 39cc1fb7f1fde9118ebba692f9bf62725f23fb3e (diff) | |
download | chef-tball/finish-2688.tar.gz |
Fixing failing appveyor teststball/finish-2688
-rw-r--r-- | spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb b/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb index 1eddd54b6a..afbba8509f 100644 --- a/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +++ b/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb @@ -83,21 +83,22 @@ describe Chef::GuardInterpreter::ResourceGuardInterpreter do expect(guard_interpreter.evaluate).to eq(true) end - describe "Script command opts switch" do + describe "script command opts switch" do let(:command_opts) { {} } - let(:guard_interpreter) { Chef::GuardInterpreter::ResourceGuardInterpreter.new(parent_resource, "echo hi", command_opts) } + let(:guard_interpreter) { Chef::GuardInterpreter::ResourceGuardInterpreter.new(parent_resource, "exit 0", command_opts) } context "resource is a Script" do - context "and guard_interpreter is :script" do + context "and guard_interpreter is a :script" do let(:parent_resource) do parent_resource = Chef::Resource::Script.new("resource", run_context) - parent_resource.guard_interpreter(:script) + # Ruby scripts are cross platform to both Linux and Windows + parent_resource.guard_interpreter(:ruby) parent_resource end it "merges to :code" do - expect(command_opts).to receive(:merge).with({:code => "echo hi"}).and_call_original - guard_interpreter.evaluate + expect(command_opts).to receive(:merge).with({:code => "exit 0"}).and_call_original + expect(guard_interpreter.evaluate).to eq(true) end end @@ -109,8 +110,8 @@ describe Chef::GuardInterpreter::ResourceGuardInterpreter do end it "merges to :code" do - expect(command_opts).to receive(:merge).with({:command => "echo hi"}).and_call_original - guard_interpreter.evaluate + expect(command_opts).to receive(:merge).with({:command => "exit 0"}).and_call_original + expect(guard_interpreter.evaluate).to eq(true) end end end @@ -123,8 +124,8 @@ describe Chef::GuardInterpreter::ResourceGuardInterpreter do end it "merges to :command" do - expect(command_opts).to receive(:merge).with({:command => "echo hi"}).and_call_original - guard_interpreter.evaluate + expect(command_opts).to receive(:merge).with({:command => "exit 0"}).and_call_original + expect(guard_interpreter.evaluate).to eq(true) end end |