]> source.dussan.org Git - redmine.git/commitdiff
Fixed: #setup triggers a failure even if git tests should not run.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 11 Apr 2011 17:58:04 +0000 (17:58 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 11 Apr 2011 17:58:04 +0000 (17:58 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5417 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_git_test.rb

index aac93d645dd90b202dc21e9f234dff4abf521cae..57594d277b9dec866e76a408fad5a7992c6e0421 100644 (file)
@@ -33,27 +33,27 @@ class RepositoryGitTest < ActiveSupport::TestCase
   # WINDOWS_PASS = Redmine::Platform.mswin?
   WINDOWS_PASS = false
 
-  def setup
-    klass = Repository::Git
-    assert_equal "Git", klass.scm_name
-    assert klass.scm_adapter_class
-    assert_not_equal "", klass.scm_command
-    assert_equal true, klass.scm_available
-
-    @project = Project.find(3)
-    @repository = Repository::Git.create(
-                      :project       => @project,
-                      :url           => REPOSITORY_PATH,
-                      :path_encoding => 'ISO-8859-1'
-                      )
-    assert @repository
-    @char_1        = CHAR_1_HEX.dup
-    if @char_1.respond_to?(:force_encoding)
-      @char_1.force_encoding('UTF-8')
-    end
-  end
-
   if File.directory?(REPOSITORY_PATH)
+    def setup
+      klass = Repository::Git
+      assert_equal "Git", klass.scm_name
+      assert klass.scm_adapter_class
+      assert_not_equal "", klass.scm_command
+      assert_equal true, klass.scm_available
+  
+      @project = Project.find(3)
+      @repository = Repository::Git.create(
+                        :project       => @project,
+                        :url           => REPOSITORY_PATH,
+                        :path_encoding => 'ISO-8859-1'
+                        )
+      assert @repository
+      @char_1        = CHAR_1_HEX.dup
+      if @char_1.respond_to?(:force_encoding)
+        @char_1.force_encoding('UTF-8')
+      end
+    end
+    
     def test_fetch_changesets_from_scratch
       @repository.fetch_changesets
       @repository.reload