From 4a7de0cd63a12f0d99ed9bcbd2c52c46e578d0b7 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 24 Feb 2012 11:18:37 +0000 Subject: [PATCH] scm: git: split unit model test setup whether repository required or not git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8961 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/repository_git_test.rb | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index 4730465b8..f1ba70fbf 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -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