mirror of
https://github.com/urbanadventurer/WhatWeb
synced 2026-06-21 14:12:19 +00:00
Add JSON parsing helper to Integration Tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user