summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-14 05:03:36 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-14 05:03:36 +0000
commitd43bc98a497a0ee294cd641dfe793cf1d77a5647 (patch)
treecae14e78e12578b6318d59619aeaa98eb3f8e223
parentb091c98238495e7c696efc87348dec4199edac14 (diff)
downloadredmine-d43bc98a497a0ee294cd641dfe793cf1d77a5647.tar.gz
redmine-d43bc98a497a0ee294cd641dfe793cf1d77a5647.zip
scm: cvs: update test repository.
add "tag00" tag and "branch00" branch. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5451 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/fixtures/repositories/cvs_repository.tar.gzbin12248 -> 12206 bytes
-rw-r--r--test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb4
-rw-r--r--test/unit/repository_cvs_test.rb19
3 files changed, 12 insertions, 11 deletions
diff --git a/test/fixtures/repositories/cvs_repository.tar.gz b/test/fixtures/repositories/cvs_repository.tar.gz
index 638b166b5..60f83d53c 100644
--- a/test/fixtures/repositories/cvs_repository.tar.gz
+++ b/test/fixtures/repositories/cvs_repository.tar.gz
Binary files differ
diff --git a/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
index 197d7df12..20be70802 100644
--- a/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
@@ -27,7 +27,7 @@ begin
@adapter.revisions('', nil, nil, :with_paths => true) do |revision|
cnt += 1
end
- assert_equal 14, cnt
+ assert_equal 16, cnt
end
def test_revisions_from_rev3
@@ -36,7 +36,7 @@ begin
@adapter.revisions('', rev3_committed_on, nil, :with_paths => true) do |revision|
cnt += 1
end
- assert_equal 2, cnt
+ assert_equal 4, cnt
end
def test_entries_rev3
diff --git a/test/unit/repository_cvs_test.rb b/test/unit/repository_cvs_test.rb
index c0f4a9a3c..e83f408a5 100644
--- a/test/unit/repository_cvs_test.rb
+++ b/test/unit/repository_cvs_test.rb
@@ -24,7 +24,8 @@ class RepositoryCvsTest < ActiveSupport::TestCase
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/cvs_repository'
REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin?
# CVS module
- MODULE_NAME = 'test'
+ MODULE_NAME = 'test'
+ CHANGESETS_NUM = 7
def setup
@project = Project.find(3)
@@ -41,8 +42,8 @@ class RepositoryCvsTest < ActiveSupport::TestCase
@repository.fetch_changesets
@repository.reload
- assert_equal 5, @repository.changesets.count
- assert_equal 14, @repository.changes.count
+ assert_equal CHANGESETS_NUM, @repository.changesets.count
+ assert_equal 16, @repository.changes.count
assert_not_nil @repository.changesets.find_by_comments('Two files changed')
r2 = @repository.changesets.find_by_revision('2')
@@ -69,10 +70,10 @@ class RepositoryCvsTest < ActiveSupport::TestCase
@repository.fetch_changesets
@repository.reload
- assert_equal 5, @repository.changesets.count
+ assert_equal CHANGESETS_NUM, @repository.changesets.count
- assert_equal %w|5 4 3 2 1|, @repository.changesets.collect(&:revision)
- rev5_commit = @repository.changesets.find(:first, :order => 'committed_on DESC')
+ assert_equal %w|7 6 5 4 3 2 1|, @repository.changesets.collect(&:revision)
+ rev5_commit = @repository.changesets.find_by_revision('5')
assert_equal 'HEAD-20071213-163001', rev5_commit.scmid
# 2007-12-14 01:30:01 +0900
rev5_committed_on = Time.gm(2007, 12, 13, 16, 30, 1)
@@ -83,7 +84,7 @@ class RepositoryCvsTest < ActiveSupport::TestCase
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
@repository.reload
- assert_equal 5, @repository.changesets.count
+ assert_equal CHANGESETS_NUM, @repository.changesets.count
entries = @repository.entries('sources')
assert entries.detect {|e| e.name == 'watchers_controller.rb'}
@@ -121,7 +122,7 @@ class RepositoryCvsTest < ActiveSupport::TestCase
buf = @repository.cat('README')
assert buf
lines = buf.split("\n")
- assert_equal 2, lines.length
+ assert_equal 3, lines.length
buf = lines[1].gsub(/\r$/, "")
assert_equal 'with one change', buf
buf = @repository.cat('README', '1')
@@ -145,7 +146,7 @@ class RepositoryCvsTest < ActiveSupport::TestCase
@repository.reload
ann = @repository.annotate('README')
assert ann
- assert_equal 2, ann.revisions.length
+ assert_equal 3, ann.revisions.length
assert_equal '1.2', ann.revisions[1].revision
assert_equal 'LANG', ann.revisions[1].author
assert_equal 'with one change', ann.lines[1]