summaryrefslogtreecommitdiff
path: root/spec/unit/resource/batch_spec.rb
diff options
context:
space:
mode:
authoradamedx <admed@opscode.com>2013-01-26 22:15:02 -0800
committeradamedx <adamed@opscode.com>2013-02-19 09:32:06 -0800
commita3f5ab6223e1b108dbbf464dcafd15f1872d017f (patch)
tree0ea6bfee58ef2dddf73d7bbc5aa5596485070477 /spec/unit/resource/batch_spec.rb
parent63d34bb7887606ee5d55ad70264ff14a90aa3f09 (diff)
downloadchef-a3f5ab6223e1b108dbbf464dcafd15f1872d017f.tar.gz
OC-4739: OC-4748: Refactor tests to share examples across batch and powershell resource specs
Diffstat (limited to 'spec/unit/resource/batch_spec.rb')
-rw-r--r--spec/unit/resource/batch_spec.rb23
1 files changed, 7 insertions, 16 deletions
diff --git a/spec/unit/resource/batch_spec.rb b/spec/unit/resource/batch_spec.rb
index 1e4d65da7c..119b0dd5f1 100644
--- a/spec/unit/resource/batch_spec.rb
+++ b/spec/unit/resource/batch_spec.rb
@@ -33,25 +33,16 @@ describe Chef::Resource::Batch do
end
it "should create a new Chef::Resource::Batch" do
- @resource.should be_a_kind_of(Chef::Resource)
@resource.should be_a_kind_of(Chef::Resource::Batch)
end
- it "should have a resource name of :batch" do
- @resource.resource_name.should eql(:batch)
- end
-
- it "should have an interpreter with a file name of cmd.exe" do
-
+ context "windowssystemscript" do
+ let(:resource_instance) { @resource }
+ let(:resource_instance_name ) { @resource.command }
+ let(:resource_name) { :batch }
+ let(:interpreter_file_name) { 'cmd.exe' }
- # When rspec-mocks 2.11 is released, switch to constant_stubbing
- # with const_stub below
- # stub_const("::File::ALT_SEPARATOR",::File::SEPARATOR).
- # For now, stub out a method that exists just for this purpose
-# @resource.respond_to?(:windows_separator).should == true
-# @resource.stub(:windows_separator) { ::File::SEPARATOR }
-
- @resource.interpreter.split('\\').pop.casecmp('cmd.exe').should == 0
+ it_should_behave_like "a Windows system script resource"
end
-
+
end