From: Toshi MARUYAMA Date: Sun, 2 Feb 2014 12:19:59 +0000 (+0000) Subject: scm: mercurial: use scmid_for_assert in assert_entry (#14361) X-Git-Tag: 2.5.0~127 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=642f13605ecbdb96074bd425b6150ca24b11114e;p=redmine.git scm: mercurial: use scmid_for_assert in assert_entry (#14361) git-svn-id: http://svn.redmine.org/redmine/trunk@12773 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index 7d8e8172f..d5e7b1bb5 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -115,7 +115,9 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_equal 'dir', entry.kind end - def assert_entry + def assert_entry(is_short_scmid=true) + hex = "0885933ad4f68d77c2649cd11f8311276e7ef7ce" + scmid = scmid_for_assert(hex, is_short_scmid) ["README", "/README"].each do |path| ["0", "0885933ad4f6", "0885933ad4f68d77c2649cd11f8311276e7ef7ce"].each do |rev| entry = @repository.entry(path, rev) @@ -123,7 +125,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_equal "README", entry.path assert_equal "file", entry.kind assert_equal '0', entry.lastrev.revision - assert_equal '0885933ad4f6', entry.lastrev.identifier + assert_equal scmid, entry.lastrev.identifier end end ["sources", "/sources", "/sources/"].each do |path| @@ -141,14 +143,14 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_equal "sources/watchers_controller.rb", entry.path assert_equal "file", entry.kind assert_equal '0', entry.lastrev.revision - assert_equal '0885933ad4f6', entry.lastrev.identifier + assert_equal scmid, entry.lastrev.identifier end end end private :assert_entry def test_entry_short_id - assert_entry + assert_entry(true) end def test_fetch_changesets_from_scratch