Skip to content

Instantly share code, notes, and snippets.

@ujjain
Created May 4, 2016 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ujjain/3c76eb7610c9d832f5fb499106ccb357 to your computer and use it in GitHub Desktop.
Save ujjain/3c76eb7610c9d832f5fb499106ccb357 to your computer and use it in GitHub Desktop.
log.info "Executing '#{command.join(' ')}'"
begin
timeout(config['deploy-timeout'].to_i) do
execute_and_log command
end
rescue Timeout::Error => e
$timeout_exception = "Execution Timeout Error"
log.error "#{$timeout_exception}"
raise e
end
This is my test, but even though @timeout_exception is working during running of the code, it's empty during the test. So how can I test if this variable is set?
Then(/^the output should be '(.*)'$/) do |expectedException|
expect($timeout_exception).to eq(expectedException)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment