summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-01-08 12:51:36 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-01-08 12:51:36 +0000
commit0743ba89d405fba39b94fa58a0dc4f799b604e49 (patch)
treecd31e65c9deed21b0f561b335376f547f6959d9f /test
parent0617625f487c5d3fcaf363e22896a8e9902b4169 (diff)
downloadredmine-0743ba89d405fba39b94fa58a0dc4f799b604e49.tar.gz
redmine-0743ba89d405fba39b94fa58a0dc4f799b604e49.zip
scm: mercurial: cat test for accept both of revision number and changeset id (#3724).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4661 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb10
1 files changed, 8 insertions, 2 deletions
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 db050c836..afd7b2700 100644
--- a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
@@ -43,8 +43,14 @@ begin
end
def test_cat
- assert @adapter.cat("sources/welcome_controller.rb", 2)
- assert_nil @adapter.cat("sources/welcome_controller.rb")
+ [2, '400bb8672109', '400', 400].each do |r|
+ buf = @adapter.cat('sources/welcome_controller.rb', r)
+ assert buf
+ lines = buf.split("\r\n")
+ assert_equal 25, lines.length
+ assert_equal 'class WelcomeController < ApplicationController', lines[17]
+ end
+ assert_nil @adapter.cat('sources/welcome_controller.rb')
end
def test_access_by_nodeid