ohcount: add test

Closes Homebrew/homebrew#27774.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Mike Naberezny 2014-03-21 19:57:34 -07:00 committed by Adam Vandenberg
parent c4ac64d015
commit 64edb5470f

View file

@ -22,6 +22,14 @@ class Ohcount < Formula
system "./build", "ohcount" system "./build", "ohcount"
bin.install 'bin/ohcount' bin.install 'bin/ohcount'
end end
test do
path = testpath/"test.rb"
path.write "# comment\n puts\n puts\n"
stats = `#{bin}/ohcount -i #{path}`.split("\n")[-1]
assert_equal 0, $?.exitstatus
assert_equal ["ruby", "2", "1", "33.3%"], stats.split[0..3]
end
end end
__END__ __END__