scm: cvs: add unit lib test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4793 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9f1a63075e
commit
33d6b90616
|
@ -0,0 +1,33 @@
|
||||||
|
require File.expand_path('../../../../../../test_helper', __FILE__)
|
||||||
|
begin
|
||||||
|
require 'mocha'
|
||||||
|
|
||||||
|
class CvsAdapterTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
|
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/cvs_repository'
|
||||||
|
MODULE_NAME = 'test'
|
||||||
|
|
||||||
|
if File.directory?(REPOSITORY_PATH)
|
||||||
|
def setup
|
||||||
|
@adapter = Redmine::Scm::Adapters::CvsAdapter.new(MODULE_NAME, REPOSITORY_PATH)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_revisions_all
|
||||||
|
cnt = 0
|
||||||
|
@adapter.revisions('', nil, nil, :with_paths => true) do |revision|
|
||||||
|
cnt += 1
|
||||||
|
end
|
||||||
|
assert_equal 14, cnt
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "Cvs test repository NOT FOUND. Skipping unit tests !!!"
|
||||||
|
def test_fake; assert true end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
rescue LoadError
|
||||||
|
class CvsMochaFake < ActiveSupport::TestCase
|
||||||
|
def test_fake; assert(false, "Requires mocha to run those tests") end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue