Mercurial > hg > soundsoftware-site
comparison test/unit/.svn/text-base/repository_mercurial_test.rb.svn-base @ 120:cd2282d2aa55 cannam
Merge from the default branch. Note that this is not a valid SVN repository any more (use default, redmine-1.1 etc for SVN updates).
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 14:33:08 +0000 |
parents | af80e5618e9b 8661b858af72 |
children | eeebe205a056 |
comparison
equal
deleted
inserted
replaced
118:b859cc0c4fa1 | 120:cd2282d2aa55 |
---|---|
33 @repository.fetch_changesets | 33 @repository.fetch_changesets |
34 @repository.reload | 34 @repository.reload |
35 | 35 |
36 assert_equal 17, @repository.changesets.count | 36 assert_equal 17, @repository.changesets.count |
37 assert_equal 25, @repository.changes.count | 37 assert_equal 25, @repository.changes.count |
38 assert_equal "Initial import.\nThe repository contains 3 files.", @repository.changesets.find_by_revision('0').comments | 38 assert_equal "Initial import.\nThe repository contains 3 files.", |
39 @repository.changesets.find_by_revision('0').comments | |
39 end | 40 end |
40 | 41 |
41 def test_fetch_changesets_incremental | 42 def test_fetch_changesets_incremental |
42 @repository.fetch_changesets | 43 @repository.fetch_changesets |
43 # Remove changesets with revision > 2 | 44 # Remove changesets with revision > 2 |
49 assert_equal 17, @repository.changesets.count | 50 assert_equal 17, @repository.changesets.count |
50 end | 51 end |
51 | 52 |
52 def test_entries | 53 def test_entries |
53 assert_equal 2, @repository.entries("sources", 2).size | 54 assert_equal 2, @repository.entries("sources", 2).size |
55 assert_equal 2, @repository.entries("sources", '400bb8672109').size | |
54 assert_equal 1, @repository.entries("sources", 3).size | 56 assert_equal 1, @repository.entries("sources", 3).size |
57 assert_equal 1, @repository.entries("sources", 'b3a615152df8').size | |
55 end | 58 end |
56 | 59 |
57 def test_locate_on_outdated_repository | 60 def test_locate_on_outdated_repository |
58 assert_equal 1, @repository.entries("images", 0).size | 61 assert_equal 1, @repository.entries("images", 0).size |
59 assert_equal 2, @repository.entries("images").size | 62 assert_equal 2, @repository.entries("images").size |
120 | 123 |
121 assert_equal 'A', c2[0].action | 124 assert_equal 'A', c2[0].action |
122 assert_equal '/README (1)[2]&,%.-3_4', c2[0].path | 125 assert_equal '/README (1)[2]&,%.-3_4', c2[0].path |
123 assert_equal '/README', c2[0].from_path | 126 assert_equal '/README', c2[0].from_path |
124 end | 127 end |
128 | |
129 def test_find_changeset_by_name | |
130 @repository.fetch_changesets | |
131 @repository.reload | |
132 %w|2 400bb8672109 400|.each do |r| | |
133 assert_equal '2', @repository.find_changeset_by_name(r).revision | |
134 end | |
135 end | |
136 | |
137 def test_find_changeset_by_invalid_name | |
138 @repository.fetch_changesets | |
139 @repository.reload | |
140 assert_nil @repository.find_changeset_by_name('100000') | |
141 end | |
142 | |
143 def test_identifier | |
144 @repository.fetch_changesets | |
145 @repository.reload | |
146 c = @repository.changesets.find_by_revision('2') | |
147 assert_equal c.scmid, c.identifier | |
148 end | |
149 | |
150 def test_format_identifier | |
151 @repository.fetch_changesets | |
152 @repository.reload | |
153 c = @repository.changesets.find_by_revision('2') | |
154 assert_equal '2:400bb8672109', c.format_identifier | |
155 end | |
156 | |
157 def test_find_changeset_by_empty_name | |
158 @repository.fetch_changesets | |
159 @repository.reload | |
160 ['', ' ', nil].each do |r| | |
161 assert_nil @repository.find_changeset_by_name(r) | |
162 end | |
163 end | |
164 | |
165 def test_activities | |
166 c = Changeset.new(:repository => @repository, | |
167 :committed_on => Time.now, | |
168 :revision => '123', | |
169 :scmid => 'abc400bb8672', | |
170 :comments => 'test') | |
171 assert c.event_title.include?('123:abc400bb8672:') | |
172 assert_equal 'abc400bb8672', c.event_url[:rev] | |
173 end | |
125 else | 174 else |
126 puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!" | 175 puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!" |
127 def test_fake; assert true end | 176 def test_fake; assert true end |
128 end | 177 end |
129 end | 178 end |