]> source.dussan.org Git - redmine.git/commitdiff
scm: git: split unit model test setup whether repository required or not
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 24 Feb 2012 11:18:37 +0000 (11:18 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 24 Feb 2012 11:18:37 +0000 (11:18 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8961 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_git_test.rb

index 4730465b8383554db79e47718a0561a60007a969..f1ba70fbfe7c3522de3ff04d4dbf70a07f3d0b74 100644 (file)
@@ -43,25 +43,27 @@ class RepositoryGitTest < ActiveSupport::TestCase
   JRUBY_SKIP     = (RUBY_PLATFORM == 'java')
   JRUBY_SKIP_STR = "TODO: This test fails in JRuby"
 
+  def setup
+    @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
+    def test_scm_available
       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