Mercurial > hg > soundsoftware-site
comparison test/unit/repository_subversion_test.rb @ 1337:077b8890835a cannam
Merge from live branch
author | Chris Cannam |
---|---|
date | Thu, 20 Jun 2013 13:14:02 +0100 |
parents | 433d4f72a19b |
children | 622f24f53b42 261b3d9a4903 |
comparison
equal
deleted
inserted
replaced
1304:6137548ba453 | 1337:077b8890835a |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2011 Jean-Philippe Lang | 2 # Copyright (C) 2006-2012 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
34 assert_equal 0, @repository.changesets.count | 34 assert_equal 0, @repository.changesets.count |
35 @repository.fetch_changesets | 35 @repository.fetch_changesets |
36 @project.reload | 36 @project.reload |
37 | 37 |
38 assert_equal NUM_REV, @repository.changesets.count | 38 assert_equal NUM_REV, @repository.changesets.count |
39 assert_equal 20, @repository.changes.count | 39 assert_equal 20, @repository.filechanges.count |
40 assert_equal 'Initial import.', @repository.changesets.find_by_revision('1').comments | 40 assert_equal 'Initial import.', @repository.changesets.find_by_revision('1').comments |
41 end | 41 end |
42 | 42 |
43 def test_fetch_changesets_incremental | 43 def test_fetch_changesets_incremental |
44 assert_equal 0, @repository.changesets.count | 44 assert_equal 0, @repository.changesets.count |
52 assert_equal 5, @repository.changesets.count | 52 assert_equal 5, @repository.changesets.count |
53 | 53 |
54 @repository.fetch_changesets | 54 @repository.fetch_changesets |
55 @project.reload | 55 @project.reload |
56 assert_equal NUM_REV, @repository.changesets.count | 56 assert_equal NUM_REV, @repository.changesets.count |
57 end | |
58 | |
59 def test_entries | |
60 entries = @repository.entries | |
61 assert_kind_of Redmine::Scm::Adapters::Entries, entries | |
62 end | |
63 | |
64 def test_entries_for_invalid_path_should_return_nil | |
65 entries = @repository.entries('invalid_path') | |
66 assert_nil entries | |
57 end | 67 end |
58 | 68 |
59 def test_latest_changesets | 69 def test_latest_changesets |
60 assert_equal 0, @repository.changesets.count | 70 assert_equal 0, @repository.changesets.count |
61 @repository.fetch_changesets | 71 @repository.fetch_changesets |
97 assert_equal 0, @repository.changesets.count | 107 assert_equal 0, @repository.changesets.count |
98 @repository.fetch_changesets | 108 @repository.fetch_changesets |
99 @project.reload | 109 @project.reload |
100 | 110 |
101 assert_equal 1, @repository.changesets.count, 'Expected to see 1 revision' | 111 assert_equal 1, @repository.changesets.count, 'Expected to see 1 revision' |
102 assert_equal 2, @repository.changes.count, 'Expected to see 2 changes, dir add and file add' | 112 assert_equal 2, @repository.filechanges.count, 'Expected to see 2 changes, dir add and file add' |
103 | 113 |
104 entries = @repository.entries('') | 114 entries = @repository.entries('') |
105 assert_not_nil entries, 'Expect to find entries' | 115 assert_not_nil entries, 'Expect to find entries' |
106 assert_equal 1, entries.size, 'Expect a single entry' | 116 assert_equal 1, entries.size, 'Expect a single entry' |
107 assert_equal 'README.txt', entries.first.name | 117 assert_equal 'README.txt', entries.first.name |