diff options
| author | Mike Naberezny | 2014-03-21 19:57:34 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2014-03-21 21:59:11 -0700 |
| commit | cda2d1f536676a5d2db218ccde09f898e0362063 (patch) | |
| tree | b9e03469f03986f0283d1b3b69af93425401cbaf /Library/Formula/ohcount.rb | |
| parent | c3279cf4dc991b999238aa266e89c2af3bc52194 (diff) | |
| download | homebrew-cda2d1f536676a5d2db218ccde09f898e0362063.tar.bz2 | |
ohcount: add test
Closes #27774.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/ohcount.rb')
| -rw-r--r-- | Library/Formula/ohcount.rb | 8 |
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__ |
