diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-05-01 08:32:21 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-05-01 08:32:21 +0000 |
commit | 1be15816dd30d10339a0dcf2faf44da31fc3e8e5 (patch) | |
tree | b4a2d86d9dc975657695a3681e067675c8223d8a /test/unit | |
parent | 80f7faf10aa5a572b25adf2b08a80777472af7b1 (diff) | |
download | redmine-1be15816dd30d10339a0dcf2faf44da31fc3e8e5.tar.gz redmine-1be15816dd30d10339a0dcf2faf44da31fc3e8e5.zip |
Adds test helpers for test repositories.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3720 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb | 6 | ||||
-rw-r--r-- | test/unit/repository_subversion_test.rb | 7 |
2 files changed, 4 insertions, 9 deletions
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 e44d12f2d..4fc56cbc3 100644 --- a/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb @@ -15,19 +15,17 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require 'mkmf' - require File.dirname(__FILE__) + '/../../../../../test_helper' class SubversionAdapterTest < ActiveSupport::TestCase - if find_executable0('svn') + if repository_configured?('subversion') def test_client_version v = Redmine::Scm::Adapters::SubversionAdapter.client_version assert v.is_a?(Array) end else - puts "Subversion binary NOT FOUND. Skipping unit tests !!!" + puts "Subversion test repository NOT FOUND. Skipping unit tests !!!" def test_fake; assert true end end end diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb index fb5580c42..a2394facd 100644 --- a/test/unit/repository_subversion_test.rb +++ b/test/unit/repository_subversion_test.rb @@ -20,15 +20,12 @@ require File.dirname(__FILE__) + '/../test_helper' class RepositorySubversionTest < ActiveSupport::TestCase fixtures :projects - # No '..' in the repository path for svn - REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/subversion_repository' - def setup @project = Project.find(1) - assert @repository = Repository::Subversion.create(:project => @project, :url => "file:///#{REPOSITORY_PATH}") + assert @repository = Repository::Subversion.create(:project => @project, :url => "file:///#{self.class.repository_path('subversion')}") end - if File.directory?(REPOSITORY_PATH) + if repository_configured?('subversion') def test_fetch_changesets_from_scratch @repository.fetch_changesets @repository.reload |