summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_mercurial_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-02-02 04:43:48 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-02-02 04:43:48 +0000
commit07d7b47ddcfa4dfcbf187d642dfafc3c0c820335 (patch)
tree218fa06d91346577a659bf44ab558490fbe75994 /test/unit/repository_mercurial_test.rb
parent1662720d7b993812bf59842dac47fb4bca7da58e (diff)
downloadredmine-07d7b47ddcfa4dfcbf187d642dfafc3c0c820335.tar.gz
redmine-07d7b47ddcfa4dfcbf187d642dfafc3c0c820335.zip
scm: mercurial: add model entry test (#14361)
git-svn-id: http://svn.redmine.org/redmine/trunk@12758 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_mercurial_test.rb')
-rw-r--r--test/unit/repository_mercurial_test.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb
index 7ac4b66aa..74aae6f7d 100644
--- a/test/unit/repository_mercurial_test.rb
+++ b/test/unit/repository_mercurial_test.rb
@@ -103,6 +103,44 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
end
end
+ def test_entry_on_tip
+ entry = @repository.entry
+ assert_kind_of Redmine::Scm::Adapters::Entry, entry
+ assert_equal "", entry.path
+ assert_equal 'dir', entry.kind
+ end
+
+ def test_entry_short_id
+ ["README", "/README"].each do |path|
+ ["0", "0885933ad4f6", "0885933ad4f68d77c2649cd11f8311276e7ef7ce"].each do |rev|
+ entry = @repository.entry(path, rev)
+ assert_kind_of Redmine::Scm::Adapters::Entry, entry
+ assert_equal "README", entry.path
+ assert_equal "file", entry.kind
+ assert_equal '0', entry.lastrev.revision
+ assert_equal '0885933ad4f6', entry.lastrev.identifier
+ end
+ end
+ ["sources", "/sources", "/sources/"].each do |path|
+ ["0", "0885933ad4f6", "0885933ad4f68d77c2649cd11f8311276e7ef7ce"].each do |rev|
+ entry = @repository.entry(path, rev)
+ assert_kind_of Redmine::Scm::Adapters::Entry, entry
+ assert_equal "sources", entry.path
+ assert_equal "dir", entry.kind
+ end
+ end
+ ["sources/watchers_controller.rb", "/sources/watchers_controller.rb"].each do |path|
+ ["0", "0885933ad4f6", "0885933ad4f68d77c2649cd11f8311276e7ef7ce"].each do |rev|
+ entry = @repository.entry(path, rev)
+ assert_kind_of Redmine::Scm::Adapters::Entry, entry
+ 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
+ end
+ end
+ end
+
def test_fetch_changesets_from_scratch
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets