inspec/test/integration/default/vbscript_spec.rb

28 lines
594 B
Ruby
Raw Normal View History

2016-03-18 22:22:15 +00:00
# encoding: utf-8
2016-05-10 17:23:11 +00:00
return unless os.windows?
describe vbscript("WScript.Echo \"hello\"") do
its('stdout') { should eq "hello\r\n" }
end
2016-03-18 22:22:15 +00:00
# script that may have multiple lines
vbscript = <<-EOH
WScript.Echo "hello"
Wscript.Stdout.Write "end"
2016-03-18 22:22:15 +00:00
EOH
describe vbscript(vbscript) do
its('stdout') { should eq "hello\r\nend" }
2016-03-18 22:22:15 +00:00
end
# remove whitespace from stdout
describe vbscript("WScript.Echo \"hello\"") do
its('strip') { should eq 'hello' }
2016-03-26 21:35:33 +00:00
end
2016-03-18 22:22:15 +00:00
# ensure that we do not require a newline
describe vbscript("Wscript.Stdout.Write \"hello\"") do
its('stdout') { should eq 'hello' }
end