Add JSON parsing helper to Integration Tests

This commit is contained in:
urbanadventurer
2020-01-22 07:02:27 +11:00
parent cc536c4a3b
commit 2a7e778cd8
+8
View File
@@ -6,6 +6,7 @@
##
require 'minitest/autorun'
require 'open3'
require 'json'
class WhatWebTest < Minitest::Test
@@ -13,6 +14,13 @@ class WhatWebTest < Minitest::Test
@test_host = 'whatweb.net'
end
def valid_json?(json)
JSON.parse(json)
return true
rescue JSON::ParserError => e
return false
end
def test_version
p = IO.popen(['./whatweb', '--version'], 'r+')
res = p.read.to_s