Skip to content

Instantly share code, notes, and snippets.

@awls99
Last active August 29, 2015 13:55
Show Gist options
  • Save awls99/8693137 to your computer and use it in GitHub Desktop.
Save awls99/8693137 to your computer and use it in GitHub Desktop.
require 'thwait'
Then /^all links are valid$/ do
errors = []
threads = []
@links.each do |link|
threads << Thread.new do
last_response = get link.url
errors.push "#{link.url} LINK IS BROKEN" unless last_response.success?
end
end
ThreadsWait.all_waits(*threads)
assert !errors.empty?, "There are errors: #{errors.join("\n")}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment