2016-03-18 22:22:15 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2016-05-10 17:23:11 +00:00
|
|
|
return unless os.windows?
|
|
|
|
|
2016-09-04 17:32:48 +00:00
|
|
|
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"
|
2016-09-04 17:32:48 +00:00
|
|
|
Wscript.Stdout.Write "end"
|
2016-03-18 22:22:15 +00:00
|
|
|
EOH
|
|
|
|
|
|
|
|
describe vbscript(vbscript) do
|
2016-09-04 17:32:48 +00:00
|
|
|
its('stdout') { should eq "hello\r\nend" }
|
2016-03-18 22:22:15 +00:00
|
|
|
end
|
|
|
|
|
2016-09-04 17:32:48 +00:00
|
|
|
# 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
|