]> source.dussan.org Git - redmine.git/commitdiff
repository: switch darcs cat test if cat supports.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 1 Jan 2011 22:01:28 +0000 (22:01 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 1 Jan 2011 22:01:28 +0000 (22:01 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4608 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_darcs_test.rb

index c612a716e36be411710d3b9e6523d2054fd174e3..d470bebfa65d488882f87525ee2992cd1af52201 100644 (file)
@@ -54,12 +54,14 @@ class RepositoryDarcsTest < ActiveSupport::TestCase
       assert entries.detect {|e| e.name == 'watchers_controller.rb'}
       assert_nil entries.detect {|e| e.name == 'welcome_controller.rb'}
     end
-    
+
     def test_cat
-      @repository.fetch_changesets
-      cat = @repository.cat("sources/welcome_controller.rb", 2)
-      assert_not_nil cat
-      assert cat.include?('class WelcomeController < ApplicationController')
+      if @repository.scm.supports_cat?
+        @repository.fetch_changesets
+        cat = @repository.cat("sources/welcome_controller.rb", 2)
+        assert_not_nil cat
+        assert cat.include?('class WelcomeController < ApplicationController')
+      end
     end
   else
     puts "Darcs test repository NOT FOUND. Skipping unit tests !!!"