diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-18 05:55:25 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-18 05:55:25 +0000 |
commit | 0e0a8c01ea8683d451ec1a59608332c0a4b56641 (patch) | |
tree | aa9794526282a0fe362d0747a9a3a144afb033dc /test/unit/repository_mercurial_test.rb | |
parent | b3c517387a74fc3f228a3f5d6937e72e0a072c3d (diff) | |
download | redmine-0e0a8c01ea8683d451ec1a59608332c0a4b56641.tar.gz redmine-0e0a8c01ea8683d451ec1a59608332c0a4b56641.zip |
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
Diffstat (limited to 'test/unit/repository_mercurial_test.rb')
-rw-r--r-- | test/unit/repository_mercurial_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index 49bbe7ce3..df37cf073 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -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 |