Last active
August 29, 2015 13:55
-
-
Save awls99/8693137 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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