From 4ec1a004c4636fa8acdee407a1fe4a15237863ca Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Wed, 5 Feb 2014 11:53:47 -0800 Subject: [PATCH] yuicompressor: add test Closes Homebrew/homebrew#26438. Signed-off-by: Adam Vandenberg --- Formula/yuicompressor.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Formula/yuicompressor.rb b/Formula/yuicompressor.rb index bedffc569f..1dafc55a5d 100644 --- a/Formula/yuicompressor.rb +++ b/Formula/yuicompressor.rb @@ -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