aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/ohcount.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Formula/ohcount.rb b/Library/Formula/ohcount.rb
index 3f5d8e2cf..7380e122b 100644
--- a/Library/Formula/ohcount.rb
+++ b/Library/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__