summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_cvs_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-11 06:29:24 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-11 06:29:24 +0000
commit51242b967d3a9f99a527c54b262082cbb3986a27 (patch)
tree024642729938b6bc720830551811946d986c9353 /test/unit/repository_cvs_test.rb
parent71360a0f66ce34c34f36cfe8f7088b2de3a6542e (diff)
downloadredmine-51242b967d3a9f99a527c54b262082cbb3986a27.tar.gz
redmine-51242b967d3a9f99a527c54b262082cbb3986a27.zip
scm: cvs: add cat test in unit model test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5394 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_cvs_test.rb')
-rw-r--r--test/unit/repository_cvs_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/repository_cvs_test.rb b/test/unit/repository_cvs_test.rb
index 2d5db034d..6e8c2354a 100644
--- a/test/unit/repository_cvs_test.rb
+++ b/test/unit/repository_cvs_test.rb
@@ -101,6 +101,22 @@ class RepositoryCvsTest < ActiveSupport::TestCase
assert_equal entries[2].lastrev.revision, '3'
assert_equal entries[2].lastrev.author, 'LANG'
end
+
+ def test_cat
+ @repository.fetch_changesets
+ @repository.reload
+ buf = @repository.cat('README')
+ assert buf
+ lines = buf.split("\n")
+ assert_equal 2, lines.length
+ assert_equal 'with one change', lines[1]
+ buf = @repository.cat('README', 1)
+ assert buf
+ lines = buf.split("\n")
+ assert_equal 1, lines.length
+ assert_equal 'CVS test repository', lines[0]
+ assert_nil @repository.scm.cat('missing.rb')
+ end
else
puts "CVS test repository NOT FOUND. Skipping unit tests !!!"
def test_fake; assert true end