Commit c45f66c4 authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

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
parent 7c6a205a
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment