diff --git a/Formula/ohcount.rb b/Formula/ohcount.rb index 3f5d8e2cff..7380e122b3 100644 --- a/Formula/ohcount.rb +++ b/Formula/ohcount.rb @@ -22,6 +22,14 @@ class Ohcount < Formula system "./build", "ohcount" bin.install 'bin/ohcount' 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__