From 7a35682cd9aca946ad37efc5e902d47f60536929 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 13 Jan 2011 12:05:11 +0000 Subject: [PATCH] scm: mercurial: unit lib test for entries accept both of revision number and changeset id (#3724, #3421) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4705 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../scm/adapters/mercurial_adapter_test.rb | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb index 24862681a..65e4a23d6 100644 --- a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb @@ -93,6 +93,32 @@ begin end end + # TODO filesize etc. + def test_entries + assert_nil @adapter.entries(nil, '100000') + [2, '400bb8672109', '400', 400].each do |r| + entries1 = @adapter.entries(nil, r) + assert entries1 + assert_equal 3, entries1.size + assert_equal 'sources', entries1[1].name + assert_equal 'sources', entries1[1].path + assert_equal 'dir', entries1[1].kind + assert_equal 'README', entries1[2].name + assert_equal 'README', entries1[2].path + assert_equal 'file', entries1[2].kind + + entries2 = @adapter.entries('sources', r) + assert entries2 + assert_equal 2, entries2.size + assert_equal 'watchers_controller.rb', entries2[0].name + assert_equal 'sources/watchers_controller.rb', entries2[0].path + assert_equal 'file', entries2[0].kind + assert_equal 'welcome_controller.rb', entries2[1].name + assert_equal 'sources/welcome_controller.rb', entries2[1].path + assert_equal 'file', entries2[1].kind + end + end + def test_access_by_nodeid path = 'sources/welcome_controller.rb' assert_equal @adapter.cat(path, 2), @adapter.cat(path, '400bb8672109') -- 2.39.5