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
This commit is contained in:
Toshi MARUYAMA 2011-04-11 06:29:24 +00:00
parent 71360a0f66
commit 51242b967d

View File

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