From e47f1d5595013b411f3fa109308344596f0bcff1 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 23 Jan 2011 04:02:15 +0000 Subject: [PATCH] Merged r4742 from trunk. scm: darcs: add unit lib test. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.1-stable@4745 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../scm/adapters/darcs_adapter_test.rb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/unit/lib/redmine/scm/adapters/darcs_adapter_test.rb diff --git a/test/unit/lib/redmine/scm/adapters/darcs_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/darcs_adapter_test.rb new file mode 100644 index 000000000..ddcea89b6 --- /dev/null +++ b/test/unit/lib/redmine/scm/adapters/darcs_adapter_test.rb @@ -0,0 +1,25 @@ +require File.expand_path('../../../../../../test_helper', __FILE__) +begin + require 'mocha' + + class DarcsAdapterTest < ActiveSupport::TestCase + + REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/darcs_repository' + + if File.directory?(REPOSITORY_PATH) + def setup + @adapter = Redmine::Scm::Adapters::DarcsAdapter.new(REPOSITORY_PATH) + end + + else + puts "Darcs test repository NOT FOUND. Skipping unit tests !!!" + def test_fake; assert true end + end + end + +rescue LoadError + class DarcsMochaFake < ActiveSupport::TestCase + def test_fake; assert(false, "Requires mocha to run those tests") end + end +end + -- 2.39.5