summaryrefslogtreecommitdiff
path: root/spec/functional/resource/batch_spec.rb
diff options
context:
space:
mode:
authoradamedx <adamed@opscode.com>2013-06-25 05:43:13 -0700
committeradamedx <adamed@opscode.com>2013-06-25 06:05:11 -0700
commitf35150c6f099180f4273a240664ec35668d66011 (patch)
tree799f968a62ced148dc1d18b945176e886b867d4c /spec/functional/resource/batch_spec.rb
parent5324bdd06ebaef013776950fb6ad97b78a8e9b1c (diff)
downloadchef-f35150c6f099180f4273a240664ec35668d66011.tar.gz
Add functional tests for exit code and flags, fix architecture test verification
Diffstat (limited to 'spec/functional/resource/batch_spec.rb')
-rw-r--r--spec/functional/resource/batch_spec.rb18
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/functional/resource/batch_spec.rb b/spec/functional/resource/batch_spec.rb
index 4374dd0730..7f7125a91e 100644
--- a/spec/functional/resource/batch_spec.rb
+++ b/spec/functional/resource/batch_spec.rb
@@ -19,23 +19,18 @@
require 'spec_helper'
shared_context Chef::Resource::WindowsScript do
- let(:ohai) do
+ before(:all) do
+
ohai_reader = Ohai::System.new
ohai_reader.require_plugin("os")
ohai_reader.require_plugin("windows::platform")
- ohai_reader
- end
- let(:node) do
new_node = Chef::Node.new
- new_node.consume_external_attrs(ohai.data,{})
- new_node
- end
-
- let(:run_context) do
+ new_node.consume_external_attrs(ohai_reader.data,{})
+
events = Chef::EventDispatch::Dispatcher.new
- run_context = Chef::RunContext.new(node, {}, events)
+ @run_context = Chef::RunContext.new(new_node, {}, events)
end
let(:script_output_path) do
@@ -51,12 +46,11 @@ k File.delete(script_output_path) if File.exists?(script_output_path)
end
end
-
describe Chef::Resource::WindowsScript::Batch, :windows_only do
let(:script_content) { "whoami" }
let!(:resource) do
- Chef::Resource::WindowsScript::Batch.new("Batch resource functional test", run_context)
+ Chef::Resource::WindowsScript::Batch.new("Batch resource functional test", @run_context)
end
context "when the run action is invoked on Windows" do