summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-11 04:38:26 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-11 04:38:26 +0000
commit542e0cb88d2035049545f3c608af24a9065d4aea (patch)
tree8068da277dc19650be4f57fbab715ec54304c00c /test
parent732ee35b2fdb36921d02cbbefdae115a88d84485 (diff)
downloadredmine-542e0cb88d2035049545f3c608af24a9065d4aea.tar.gz
redmine-542e0cb88d2035049545f3c608af24a9065d4aea.zip
scm: mercurial: fix unit model test fails on MySQL and remove duplicates tests.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5089 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/repository_mercurial_test.rb47
1 files changed, 16 insertions, 31 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb
index 7bb839046..281bb1004 100644
--- a/test/unit/repository_mercurial_test.rb
+++ b/test/unit/repository_mercurial_test.rb
@@ -87,7 +87,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
# with_limit
changesets = @repository.latest_changesets('', nil, 2)
- assert_equal @repository.latest_changesets('', nil)[0, 2], changesets
+ assert_equal %w|28 27|, changesets.collect(&:revision)
# with_filepath
changesets = @repository.latest_changesets('/sql_escape/percent%dir/percent%file1.txt', nil)
@@ -95,6 +95,21 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
changesets = @repository.latest_changesets('/sql_escape/underscore_dir/understrike_file.txt', nil)
assert_equal %w|12 9|, changesets.collect(&:revision)
+
+ changesets = @repository.latest_changesets('README', nil)
+ assert_equal %w|28 17 8 6 1 0|, changesets.collect(&:revision)
+
+ # with_dirpath
+ changesets = @repository.latest_changesets('images', nil)
+ assert_equal %w|1 0|, changesets.collect(&:revision)
+
+ path = 'sql_escape/percent%dir'
+ changesets = @repository.latest_changesets(path, nil)
+ assert_equal %w|13 11 10 9|, changesets.collect(&:revision)
+
+ path = 'sql_escape/underscore_dir'
+ changesets = @repository.latest_changesets(path, nil)
+ assert_equal %w|13 12 9|, changesets.collect(&:revision)
end
def test_copied_files
@@ -183,36 +198,6 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
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|28 17 8 6 1 0|, changesets.collect(&:revision)
-
- path = 'sql_escape/percent%dir/percent%file1.txt'
- changesets = @repository.latest_changesets(path, nil)
- assert_equal %w|11 10 9|, changesets.collect(&:revision)
-
- path = 'sql_escape/underscore_dir/understrike_file.txt'
- changesets = @repository.latest_changesets(path, nil)
- assert_equal %w|12 9|, 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)
-
- path = 'sql_escape/percent%dir'
- changesets = @repository.latest_changesets(path, nil)
- assert_equal %w|13 11 10 9|, changesets.collect(&:revision)
-
- path = 'sql_escape/underscore_dir'
- changesets = @repository.latest_changesets(path, nil)
- assert_equal %w|13 12 9|, changesets.collect(&:revision)
- end
-
def test_previous
@repository.fetch_changesets
@repository.reload