Skip to content

Commit

Permalink
jflex: improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
tdsmith committed Mar 2, 2016
1 parent c3333f4 commit a913022
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Library/Formula/jflex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ class Jflex < Formula
url "http://jflex.de/release/jflex-1.6.1.zip"
sha256 "6da3c573db065f535c9b544e46ab4d49caa629b0354f8340df027f35e3368a51"

bottle :unneeded

depends_on :java => "1.7+"

def install
pkgshare.install "examples"
libexec.install "lib/jflex-#{version}.jar"
bin.write_jar_script libexec/"jflex-#{version}.jar", "jflex"
end

test do
# jflex returns non-zero exit code on success, see https://github.com/jflex-de/jflex/issues/194
assert_equal "This is JFlex #{version}", shell_output("#{bin}/jflex --version", 1).strip
system bin/"jflex", "-d", testpath, pkgshare/"examples/java/java.flex"
assert_match /public static void/, (testpath/"Scanner.java").read
end
end

0 comments on commit a913022

Please sign in to comment.