add vbscript unit test

This commit is contained in:
Christoph Hartmann 2016-03-19 17:26:30 +01:00 committed by Dominik Richter
parent 849c23d0aa
commit 4c5a3ed412

View file

@ -0,0 +1,18 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
require 'helper'
require 'inspec/resource'
describe 'Inspec::Resources::VbScript' do
vb_script = <<-EOH
WScript.Echo "hello vbscript"
EOH
it 'check if `vbscript` for windows is properly generated ' do
resource = MockLoader.new(:windows).load_resource('vbscript', vb_script)
_(resource.command).must_equal 'powershell -encodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsAJAB2AGIAcwBjAHIAaQBwAHQAIAA9ACAAQAAiAAoAIAAgACAAIABXAFMAYwByAGkAcAB0AC4ARQBjAGgAbwAgACIAaABlAGwAbABvACAAdgBiAHMAYwByAGkAcAB0ACIACgAKACIAQAAKACQAZgBpAGwAZQBuAGEAbQBlACAAPQAgAFsAUwB5AHMAdABlAG0ALgBJAE8ALgBQAGEAdABoAF0AOgA6AEcAZQB0AFQAZQBtAHAARgBpAGwAZQBOAGEAbQBlACgAKQAgACsAIAAiAC4AdgBiAHMAIgAKAE4AZQB3AC0ASQB0AGUAbQAgACQAZgBpAGwAZQBuAGEAbQBlACAALQB0AHkAcABlACAAZgBpAGwAZQAgAC0AZgBvAHIAYwBlACAALQB2AGEAbAB1AGUAIAAkAHYAYgBzAGMAcgBpAHAAdAAgAHwAIABPAHUAdAAtAE4AdQBsAGwACgBjAHMAYwByAGkAcAB0AC4AZQB4AGUAIAAvAG4AbwBsAG8AZwBvACAAJABmAGkAbABlAG4AYQBtAGUACgBSAGUAbQBvAHYAZQAtAEkAdABlAG0AIAAkAGYAaQBsAGUAbgBhAG0AZQAgAHwAIABPAHUAdAAtAE4AdQBsAGwACgA='
end
end