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
This commit is contained in:
Toshi MARUYAMA 2014-02-02 12:19:59 +00:00
parent 1cda73c1b4
commit 642f13605e
1 changed files with 6 additions and 4 deletions

View File

@ -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