Mercurial > hg > soundsoftware-site
comparison test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb @ 210:0579821a129a
Update to Redmine trunk rev 4802
author | Chris Cannam |
---|---|
date | Tue, 08 Feb 2011 13:51:46 +0000 |
parents | |
children | 051f544170fe |
comparison
equal
deleted
inserted
replaced
128:07fa8a8b56a8 | 210:0579821a129a |
---|---|
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 | |
23 def test_revisions_from_rev3 | |
24 rev3_committed_on = Time.gm(2007, 12, 13, 16, 27, 22) | |
25 cnt = 0 | |
26 @adapter.revisions('', rev3_committed_on, nil, :with_paths => true) do |revision| | |
27 cnt += 1 | |
28 end | |
29 assert_equal 2, cnt | |
30 end | |
31 else | |
32 puts "Cvs test repository NOT FOUND. Skipping unit tests !!!" | |
33 def test_fake; assert true end | |
34 end | |
35 end | |
36 | |
37 rescue LoadError | |
38 class CvsMochaFake < ActiveSupport::TestCase | |
39 def test_fake; assert(false, "Requires mocha to run those tests") end | |
40 end | |
41 end | |
42 |