phantomjs: add test

Closes Homebrew/homebrew#26801.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Mike Naberezny 2014-02-17 18:02:09 -08:00 committed by Adam Vandenberg
parent 2129c822bd
commit 7991cabf03

View file

@ -28,4 +28,16 @@ class Phantomjs < Formula
bin.install 'bin/phantomjs'
(share+'phantomjs').install 'examples'
end
test do
path = testpath/"test.js"
path.write <<-EOS
console.log('hello');
phantom.exit();
EOS
output = `#{bin}/phantomjs #{path}`.strip
assert_equal "hello", output
assert_equal 0, $?.exitstatus
end
end