goaccess: replace Utils::JSON with corelib JSON.

This commit is contained in:
William Woodruff 2016-11-20 13:57:49 -05:00
parent e518c6dd9a
commit 9340f46bd8
No known key found for this signature in database
GPG key ID: 85AE00C504833B3C

View file

@ -36,14 +36,12 @@ class Goaccess < Formula
end
test do
require "utils/json"
(testpath/"access.log").write <<-EOS.undent
127.0.0.1 - - [04/May/2015:15:48:17 +0200] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36"
EOS
output = shell_output("#{bin}/goaccess --time-format=%T --date-format=%d/%b/%Y --log-format='%h %^[%d:%t %^] \"%r\" %s %b \"%R\" \"%u\"' -f access.log -o json 2>/dev/null")
assert_equal "Chrome", Utils::JSON.load(output)["browsers"]["data"][0]["data"]
assert_equal "Chrome", JSON.parse(output)["browsers"]["data"][0]["data"]
end
end