##// END OF EJS Templates
scm: cvs: add unit lib test....
Toshi MARUYAMA -
r4673:33d6b906166a
parent child
Show More
@@ -0,0 +1,33
1 require File.expand_path('../../../../../../test_helper', __FILE__)
2 begin
3 require 'mocha'
4
5 class CvsAdapterTest < ActiveSupport::TestCase
6
7 REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/cvs_repository'
8 MODULE_NAME = 'test'
9
10 if File.directory?(REPOSITORY_PATH)
11 def setup
12 @adapter = Redmine::Scm::Adapters::CvsAdapter.new(MODULE_NAME, REPOSITORY_PATH)
13 end
14
15 def test_revisions_all
16 cnt = 0
17 @adapter.revisions('', nil, nil, :with_paths => true) do |revision|
18 cnt += 1
19 end
20 assert_equal 14, cnt
21 end
22 else
23 puts "Cvs test repository NOT FOUND. Skipping unit tests !!!"
24 def test_fake; assert true end
25 end
26 end
27
28 rescue LoadError
29 class CvsMochaFake < ActiveSupport::TestCase
30 def test_fake; assert(false, "Requires mocha to run those tests") end
31 end
32 end
33
General Comments 0
You need to be logged in to leave comments. Login now