##// END OF EJS Templates
scm: subversion: remove trailing white-spaces from unit model test....
Toshi MARUYAMA -
r5585:c29bc896ccb0
parent child
Show More
@@ -5,12 +5,12
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.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -18,7 +18,7
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class RepositorySubversionTest < ActiveSupport::TestCase
20 class RepositorySubversionTest < ActiveSupport::TestCase
21 fixtures :projects, :repositories, :enabled_modules, :users, :roles
21 fixtures :projects, :repositories, :enabled_modules, :users, :roles
22
22
23 def setup
23 def setup
24 @project = Project.find(3)
24 @project = Project.find(3)
@@ -31,7 +31,7 class RepositorySubversionTest < ActiveSupport::TestCase
31 def test_fetch_changesets_from_scratch
31 def test_fetch_changesets_from_scratch
32 @repository.fetch_changesets
32 @repository.fetch_changesets
33 @repository.reload
33 @repository.reload
34
34
35 assert_equal 11, @repository.changesets.count
35 assert_equal 11, @repository.changesets.count
36 assert_equal 20, @repository.changes.count
36 assert_equal 20, @repository.changes.count
37 assert_equal 'Initial import.', @repository.changesets.find_by_revision('1').comments
37 assert_equal 'Initial import.', @repository.changesets.find_by_revision('1').comments
@@ -43,23 +43,23 class RepositorySubversionTest < ActiveSupport::TestCase
43 @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 5}
43 @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 5}
44 @repository.reload
44 @repository.reload
45 assert_equal 5, @repository.changesets.count
45 assert_equal 5, @repository.changesets.count
46
46
47 @repository.fetch_changesets
47 @repository.fetch_changesets
48 assert_equal 11, @repository.changesets.count
48 assert_equal 11, @repository.changesets.count
49 end
49 end
50
50
51 def test_latest_changesets
51 def test_latest_changesets
52 @repository.fetch_changesets
52 @repository.fetch_changesets
53
53
54 # with limit
54 # with limit
55 changesets = @repository.latest_changesets('', nil, 2)
55 changesets = @repository.latest_changesets('', nil, 2)
56 assert_equal 2, changesets.size
56 assert_equal 2, changesets.size
57 assert_equal @repository.latest_changesets('', nil).slice(0,2), changesets
57 assert_equal @repository.latest_changesets('', nil).slice(0,2), changesets
58
58
59 # with path
59 # with path
60 changesets = @repository.latest_changesets('subversion_test/folder', nil)
60 changesets = @repository.latest_changesets('subversion_test/folder', nil)
61 assert_equal ["10", "9", "7", "6", "5", "2"], changesets.collect(&:revision)
61 assert_equal ["10", "9", "7", "6", "5", "2"], changesets.collect(&:revision)
62
62
63 # with path and revision
63 # with path and revision
64 changesets = @repository.latest_changesets('subversion_test/folder', 8)
64 changesets = @repository.latest_changesets('subversion_test/folder', 8)
65 assert_equal ["7", "6", "5", "2"], changesets.collect(&:revision)
65 assert_equal ["7", "6", "5", "2"], changesets.collect(&:revision)
@@ -68,7 +68,7 class RepositorySubversionTest < ActiveSupport::TestCase
68 def test_directory_listing_with_square_brackets_in_path
68 def test_directory_listing_with_square_brackets_in_path
69 @repository.fetch_changesets
69 @repository.fetch_changesets
70 @repository.reload
70 @repository.reload
71
71
72 entries = @repository.entries('subversion_test/[folder_with_brackets]')
72 entries = @repository.entries('subversion_test/[folder_with_brackets]')
73 assert_not_nil entries, 'Expect to find entries in folder_with_brackets'
73 assert_not_nil entries, 'Expect to find entries in folder_with_brackets'
74 assert_equal 1, entries.size, 'Expect one entry in folder_with_brackets'
74 assert_equal 1, entries.size, 'Expect one entry in folder_with_brackets'
General Comments 0
You need to be logged in to leave comments. Login now