Add Blob#loc and Blob#sloc

This commit is contained in:
Joshua Peek
2011-05-13 15:12:40 -05:00
parent d8ee0dc9d5
commit 74b26fdfc9
2 changed files with 28 additions and 4 deletions

View File

@@ -51,10 +51,22 @@ class TestBlob < Test::Unit::TestCase
assert_equal "module Foo\nend\n", blob("foo.rb").data
end
def test_lines
assert_equal ["module Foo", "end", ""], blob("foo.rb").lines
end
def test_size
assert_equal 15, blob("foo.rb").size
end
def test_loc
assert_equal 3, blob("foo.rb").loc
end
def test_sloc
assert_equal 2, blob("foo.rb").sloc
end
def test_binary
assert blob("linguist.gem").binary?
assert blob("git.deb").binary?