Commit 07e2c652 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang Committed by Eric Davis

Fixes subversion tests not running on win32.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5175 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 9b9c7ae9
# redMine - project management software # Redmine - project management software
# Copyright (C) 2006-2008 Jean-Philippe Lang # Copyright (C) 2006-2011 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
...@@ -37,7 +37,7 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase ...@@ -37,7 +37,7 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
@project = Project.find(PRJ_ID) @project = Project.find(PRJ_ID)
@repository = Repository::Subversion.create(:project => @project, @repository = Repository::Subversion.create(:project => @project,
:url => "file://#{self.class.repository_path('subversion')}") :url => self.class.subversion_repository_url)
assert @repository assert @repository
end end
......
# redMine - project management software # Redmine - project management software
# Copyright (C) 2006 Jean-Philippe Lang # Copyright (C) 2006-2011 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
...@@ -109,6 +109,13 @@ class ActiveSupport::TestCase ...@@ -109,6 +109,13 @@ class ActiveSupport::TestCase
File.join(RAILS_ROOT.gsub(%r{config\/\.\.}, ''), "/tmp/test/#{vendor.downcase}_repository") File.join(RAILS_ROOT.gsub(%r{config\/\.\.}, ''), "/tmp/test/#{vendor.downcase}_repository")
end end
# Returns the url of the subbversion test repository
def self.subversion_repository_url
path = repository_path('subversion')
path = '/' + path unless path.starts_with?('/')
"file://#{path}"
end
# Returns true if the +vendor+ test repository is configured # Returns true if the +vendor+ test repository is configured
def self.repository_configured?(vendor) def self.repository_configured?(vendor)
File.directory?(repository_path(vendor)) File.directory?(repository_path(vendor))
......
# redMine - project management software # Redmine - project management software
# Copyright (C) 2006-2008 Jean-Philippe Lang # Copyright (C) 2006-2011 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
...@@ -24,8 +24,7 @@ begin ...@@ -24,8 +24,7 @@ begin
if repository_configured?('subversion') if repository_configured?('subversion')
def setup def setup
repo_path = "file://#{self.class.repository_path('subversion')}" @adapter = Redmine::Scm::Adapters::SubversionAdapter.new(self.class.subversion_repository_url)
@adapter = Redmine::Scm::Adapters::SubversionAdapter.new(repo_path)
end end
def test_client_version def test_client_version
......
# redMine - project management software # Redmine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang # Copyright (C) 2006-2011 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
...@@ -23,7 +23,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase ...@@ -23,7 +23,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase
def setup def setup
@project = Project.find(3) @project = Project.find(3)
@repository = Repository::Subversion.create(:project => @project, @repository = Repository::Subversion.create(:project => @project,
:url => "file://#{self.class.repository_path('subversion')}") :url => self.class.subversion_repository_url)
assert @repository assert @repository
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment