scm: git: add unit adapter test of master branch revisions().

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5666 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-05-06 11:45:58 +00:00
parent e6fe554d43
commit 59d82995fe
1 changed files with 15 additions and 1 deletions

View File

@ -85,12 +85,26 @@ begin
def test_revisions_reverse_with_time def test_revisions_reverse_with_time
since2 = Time.gm(2010, 9, 30, 0, 0, 0) since2 = Time.gm(2010, 9, 30, 0, 0, 0)
revs2 = @adapter.revisions('',nil,nil,{:all => true, :since => since2, :reverse => true }) revs2 = @adapter.revisions('', nil, nil,
{:all => true, :since => since2, :reverse => true})
assert_equal 6, revs2.length assert_equal 6, revs2.length
assert_equal '67e7792ce20ccae2e4bb73eed09bb397819c8834', revs2[0].identifier assert_equal '67e7792ce20ccae2e4bb73eed09bb397819c8834', revs2[0].identifier
assert_equal '1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127', revs2[5].identifier assert_equal '1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127', revs2[5].identifier
end end
def test_revisions_master
revs1 = @adapter.revisions('', nil, "master",{})
assert_equal 15, revs1.length
assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs1[ 0].identifier
assert_equal '7234cb2750b63f47bff735edc50a1c0a433c2518', revs1[-1].identifier
revs2 = @adapter.revisions('', nil, "master",
{:reverse => true})
assert_equal 15, revs2.length
assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs2[-1].identifier
assert_equal '7234cb2750b63f47bff735edc50a1c0a433c2518', revs2[ 0].identifier
end
def test_getting_revisions_with_spaces_in_filename def test_getting_revisions_with_spaces_in_filename
assert_equal 1, @adapter.revisions("filemane with spaces.txt", assert_equal 1, @adapter.revisions("filemane with spaces.txt",
nil, nil, :all => true).length nil, nil, :all => true).length