scm: mercurial: unit app test for latest_changeset.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4869 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-02-18 05:55:25 +00:00 committed by Eric Davis
parent 7c6a205a01
commit c45f66c41e
1 changed files with 21 additions and 0 deletions

View File

@ -158,6 +158,27 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
assert c.event_title.include?('123:abc400bb8672:')
assert_equal 'abc400bb8672', c.event_url[:rev]
end
def test_latest_changesets_with_limit
@repository.fetch_changesets
@repository.reload
changesets = @repository.latest_changesets('', nil, 2)
assert_equal @repository.latest_changesets('', nil)[0, 2], changesets
end
def test_latest_changesets_with_filepath
@repository.fetch_changesets
@repository.reload
changesets = @repository.latest_changesets('README', nil)
assert_equal %w|8 6 1 0|, changesets.collect(&:revision)
end
def test_latest_changesets_with_dirpath
@repository.fetch_changesets
@repository.reload
changesets = @repository.latest_changesets('images', nil)
assert_equal %w|1 0|, changesets.collect(&:revision)
end
else
puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
def test_fake; assert true end