3 require File.dirname(__FILE__) + '/../test_helper'
5 class TestLog < Test::Unit::TestCase
11 def test_get_log_entries
13 assert(log.first.is_a?(Git::Object::Commit))
16 def test_get_log_entries
17 assert_equal(30, @git.log.size)
18 assert_equal(50, @git.log(50).size)
19 assert_equal(10, @git.log(10).size)
23 assert_equal(@git.log.to_s.split("\n").first, @git.log.first.sha)
26 def test_get_log_since
27 l = @git.log.since("2 seconds ago")
28 assert_equal(0, l.size)
30 l = @git.log.since("2 years ago")
31 assert_equal(30, l.size)
34 def test_get_log_since_file
35 l = @git.log.object('example.txt')
36 assert_equal(30, l.size)
38 l = @git.log.between('v2.5', 'test').path('example.txt')
39 assert_equal(1, l.size)
42 def test_log_file_noexist
43 assert_raise Git::GitExecuteError do
44 @git.log.object('no-exist.txt').size