]> source.dussan.org Git - redmine.git/commitdiff
scm: cvs: add cat test in unit model test.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 11 Apr 2011 06:29:24 +0000 (06:29 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 11 Apr 2011 06:29:24 +0000 (06:29 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5394 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_cvs_test.rb

index 2d5db034d8e025596845c6172b585b92bdd6dbe5..6e8c2354ac1fc33fccc7106cd113d2a1bdf7a6f2 100644 (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