inspec/test/integration/default/controls/vbscript_spec.rb
Christoph Hartmann 47eabbb221 add functional tests for inspec check (#2077)
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-08-15 20:41:24 +02:00

27 lines
594 B
Ruby

# encoding: utf-8
return unless os.windows?
describe vbscript("WScript.Echo \"hello\"") do
its('stdout') { should eq "hello\r\n" }
end
# script that may have multiple lines
vbscript = <<-EOH
WScript.Echo "hello"
Wscript.Stdout.Write "end"
EOH
describe vbscript(vbscript) do
its('stdout') { should eq "hello\r\nend" }
end
# remove whitespace from stdout
describe vbscript("WScript.Echo \"hello\"") do
its('strip') { should eq 'hello' }
end
# ensure that we do not require a newline
describe vbscript("Wscript.Stdout.Write \"hello\"") do
its('stdout') { should eq 'hello' }
end