diff options
author | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-08 17:07:04 -0800 |
---|---|---|
committer | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-08 17:07:04 -0800 |
commit | 1f63953f05a4afe74f881d54f69f77da513939d5 (patch) | |
tree | 5fabd81a82d8aa3df0e9cdc10b0ed7f6ff141b8a /tests/units/test_log.rb | |
parent | b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b (diff) | |
download | third_party-ruby-git-1f63953f05a4afe74f881d54f69f77da513939d5.tar.gz third_party-ruby-git-1f63953f05a4afe74f881d54f69f77da513939d5.tar.xz third_party-ruby-git-1f63953f05a4afe74f881d54f69f77da513939d5.zip |
moved the git objects into the object.rb file
Diffstat (limited to 'tests/units/test_log.rb')
-rw-r--r-- | tests/units/test_log.rb | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/units/test_log.rb b/tests/units/test_log.rb index 4dd6a2f..ddd4988 100644 --- a/tests/units/test_log.rb +++ b/tests/units/test_log.rb @@ -10,10 +10,10 @@ class TestInit < Test::Unit::TestCase def test_get_log_entries log = @git.log - assert(log.first.is_a? Git::Commit) + assert(log.first.is_a?(Git::Commit)) end - def test_get_log_entries + def test_get_log_entries assert_equal(30, @git.log.size) assert_equal(50, @git.log(50).size) assert_equal(10, @git.log(10).size) @@ -23,4 +23,29 @@ class TestInit < Test::Unit::TestCase assert_equal(@git.log.to_s.split("\n").first, @git.log.first.sha) end + def test_get_log_since + l = @git.log.since("2 seconds ago") + assert_equal(0, l.size) + + l = @git.log.since("2 years ago") + assert_equal(30, l.size) + end + + def test_get_log_since_file + l = @git.log.file('example.txt') + assert_equal(30, l.size) + + l = @git.log.between('v2.5').file('example.txt') + assert_equal(1, l.size) + + l = @git.log.between('v2.5', 'test').file('example.txt') + assert_equal(1, l.size) + end + + def test_log_file_noexist + assert_raise Git::GitExecuteError do + @git.log.file('no-exist.txt').size + end + end + end |