]> source.dussan.org Git - redmine.git/commitdiff
scm: git: test: add test of parents to unit lib test (#5501)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Oct 2011 04:59:06 +0000 (04:59 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Oct 2011 04:59:06 +0000 (04:59 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7669 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/scm/adapters/git_adapter_test.rb

index c4e5e1e917db4a4b966740e3d2b5125fd8668555..96bdb4d0a6136b20f2fbd3e40a6f7029cb55b2e3 100644 (file)
@@ -211,6 +211,32 @@ begin
                                            nil, nil, :all => true).length
       end
 
+      def test_parents
+        revs1 = []
+        @adapter.revisions('',
+                           nil,
+                           "master",
+                           {:reverse => true}) do |rev|
+          revs1 << rev
+        end
+        assert_equal 15, revs1.length
+        assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518",
+                     revs1[0].identifier
+        assert_equal nil, revs1[0].parents
+        assert_equal "899a15dba03a3b350b89c3f537e4bbe02a03cdc9",
+                     revs1[1].identifier
+        assert_equal 1, revs1[1].parents.length
+        assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518",
+                     revs1[1].parents[0]
+        assert_equal "32ae898b720c2f7eec2723d5bdd558b4cb2d3ddf",
+                     revs1[10].identifier
+        assert_equal 2, revs1[10].parents.length
+        assert_equal "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8",
+                     revs1[10].parents[0]
+        assert_equal "7e61ac704deecde634b51e59daa8110435dcb3da",
+                     revs1[10].parents[1]
+      end
+
       def test_getting_revisions_with_leading_and_trailing_spaces_in_filename
         assert_equal " filename with a leading space.txt ",
            @adapter.revisions(" filename with a leading space.txt ",