yuicompressor: add test

Closes Homebrew/homebrew#26438.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Mike Naberezny 2014-02-05 11:53:47 -08:00 committed by Adam Vandenberg
parent b918d263ca
commit 4ec1a004c4

View file

@ -9,4 +9,16 @@ class Yuicompressor < Formula
libexec.install "yuicompressor-#{version}.jar"
bin.write_jar_script libexec/"yuicompressor-#{version}.jar", "yuicompressor"
end
test do
path = testpath/"test.js"
path.write <<-EOS
var i = 1; // foo
console.log(i); // bar
EOS
output = `#{bin}/yuicompressor --nomunge --preserve-semi #{path}`.strip
assert_equal "var i=1;console.log(i);", output
assert_equal 0, $?.exitstatus
end
end