diff options
Diffstat (limited to 'spec/unit/resource/batch_spec.rb')
-rw-r--r-- | spec/unit/resource/batch_spec.rb | 23 |
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 |