diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index 7ca863d1f9a0b5177f531434e6d991aea1c73b70..26d15cd55fc2276c1e16f77a47a7572f9297d295 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006-2008 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -37,7 +37,7 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase @project = Project.find(PRJ_ID) @repository = Repository::Subversion.create(:project => @project, - :url => "file://#{self.class.repository_path('subversion')}") + :url => self.class.subversion_repository_url) assert @repository end diff --git a/test/test_helper.rb b/test/test_helper.rb index d270393b893b6e868beb3c9657f02131c81eeb0d..bf14b14bb4eb5b78a0b50025700cece4b57489fe 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -109,6 +109,13 @@ class ActiveSupport::TestCase File.join(RAILS_ROOT.gsub(%r{config\/\.\.}, ''), "/tmp/test/#{vendor.downcase}_repository") 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 def self.repository_configured?(vendor) File.directory?(repository_path(vendor)) diff --git a/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb index 1d8b9cbe6e6a1f87713aa8bc5c942a8c85d8f1b5..bc769562cf7b2c58275ee018ccdbce4d23cccfcb 100644 --- a/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006-2008 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -24,8 +24,7 @@ begin if repository_configured?('subversion') def setup - repo_path = "file://#{self.class.repository_path('subversion')}" - @adapter = Redmine::Scm::Adapters::SubversionAdapter.new(repo_path) + @adapter = Redmine::Scm::Adapters::SubversionAdapter.new(self.class.subversion_repository_url) end def test_client_version diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb index ca3bd9b48d64b392cf9cab6f06a62c234d5fc5de..071660c2dadef25c31a6295100d0790c6081547b 100644 --- a/test/unit/repository_subversion_test.rb +++ b/test/unit/repository_subversion_test.rb @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006-2007 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -23,7 +23,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase def setup @project = Project.find(3) @repository = Repository::Subversion.create(:project => @project, - :url => "file://#{self.class.repository_path('subversion')}") + :url => self.class.subversion_repository_url) assert @repository end