]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: fix unit model test fails on MySQL and remove duplicates tests.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 11 Mar 2011 04:38:26 +0000 (04:38 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 11 Mar 2011 04:38:26 +0000 (04:38 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5089 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_mercurial_test.rb

index 7bb839046ae788ab6881e32014a64becf393f901..281bb100454c9cb12b7a9b6c2ed517ecb8237cb0 100644 (file)
@@ -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