Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Then /^the page should be valid/ do
- Tidy.path = '/usr/lib/libtidy.dylib'
- xml = Tidy.open(:show_warnings => false) do |tidy|
- xml = tidy.clean(response.body.to_s)
- tidy.errors.each do |e|
- e.to_s.split(/\n/).each do |err|
- err = Tidyerr.new(err)
- unless err.message =~ /trimming empty <[a-zA-Z]+>/
- raise "HTML Validation error: #{err.message} at line #{err.line}:#{err.column}: #{response.body.split("\n")[err.line - 1]}"
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment