##// END OF EJS Templates
add unit test to have one default repository...
Toshi MARUYAMA -
r12217:691e218a75db
parent child
Show More
@@ -1,368 +1,393
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2013 Jean-Philippe Lang
2 # Copyright (C) 2006-2013 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.
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.
17
17
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class RepositoryTest < ActiveSupport::TestCase
20 class RepositoryTest < ActiveSupport::TestCase
21 fixtures :projects,
21 fixtures :projects,
22 :trackers,
22 :trackers,
23 :projects_trackers,
23 :projects_trackers,
24 :enabled_modules,
24 :enabled_modules,
25 :repositories,
25 :repositories,
26 :issues,
26 :issues,
27 :issue_statuses,
27 :issue_statuses,
28 :issue_categories,
28 :issue_categories,
29 :changesets,
29 :changesets,
30 :changes,
30 :changes,
31 :users,
31 :users,
32 :members,
32 :members,
33 :member_roles,
33 :member_roles,
34 :roles,
34 :roles,
35 :enumerations
35 :enumerations
36
36
37 include Redmine::I18n
37 include Redmine::I18n
38
38
39 def setup
39 def setup
40 @repository = Project.find(1).repository
40 @repository = Project.find(1).repository
41 end
41 end
42
42
43 def test_blank_log_encoding_error_message
43 def test_blank_log_encoding_error_message
44 set_language_if_valid 'en'
44 set_language_if_valid 'en'
45 repo = Repository::Bazaar.new(
45 repo = Repository::Bazaar.new(
46 :project => Project.find(3),
46 :project => Project.find(3),
47 :url => "/test",
47 :url => "/test",
48 :log_encoding => ''
48 :log_encoding => ''
49 )
49 )
50 assert !repo.save
50 assert !repo.save
51 assert_include "Commit messages encoding can't be blank",
51 assert_include "Commit messages encoding can't be blank",
52 repo.errors.full_messages
52 repo.errors.full_messages
53 end
53 end
54
54
55 def test_blank_log_encoding_error_message_fr
55 def test_blank_log_encoding_error_message_fr
56 set_language_if_valid 'fr'
56 set_language_if_valid 'fr'
57 str = "Encodage des messages de commit doit \xc3\xaatre renseign\xc3\xa9(e)"
57 str = "Encodage des messages de commit doit \xc3\xaatre renseign\xc3\xa9(e)"
58 str.force_encoding('UTF-8') if str.respond_to?(:force_encoding)
58 str.force_encoding('UTF-8') if str.respond_to?(:force_encoding)
59 repo = Repository::Bazaar.new(
59 repo = Repository::Bazaar.new(
60 :project => Project.find(3),
60 :project => Project.find(3),
61 :url => "/test"
61 :url => "/test"
62 )
62 )
63 assert !repo.save
63 assert !repo.save
64 assert_include str, repo.errors.full_messages
64 assert_include str, repo.errors.full_messages
65 end
65 end
66
66
67 def test_create
67 def test_create
68 repository = Repository::Subversion.new(:project => Project.find(3))
68 repository = Repository::Subversion.new(:project => Project.find(3))
69 assert !repository.save
69 assert !repository.save
70
70
71 repository.url = "svn://localhost"
71 repository.url = "svn://localhost"
72 assert repository.save
72 assert repository.save
73 repository.reload
73 repository.reload
74
74
75 project = Project.find(3)
75 project = Project.find(3)
76 assert_equal repository, project.repository
76 assert_equal repository, project.repository
77 end
77 end
78
78
79 def test_first_repository_should_be_set_as_default
79 def test_first_repository_should_be_set_as_default
80 repository1 = Repository::Subversion.new(
80 repository1 = Repository::Subversion.new(
81 :project => Project.find(3),
81 :project => Project.find(3),
82 :identifier => 'svn1',
82 :identifier => 'svn1',
83 :url => 'file:///svn1'
83 :url => 'file:///svn1'
84 )
84 )
85 assert repository1.save
85 assert repository1.save
86 assert repository1.is_default?
86 assert repository1.is_default?
87
87
88 repository2 = Repository::Subversion.new(
88 repository2 = Repository::Subversion.new(
89 :project => Project.find(3),
89 :project => Project.find(3),
90 :identifier => 'svn2',
90 :identifier => 'svn2',
91 :url => 'file:///svn2'
91 :url => 'file:///svn2'
92 )
92 )
93 assert repository2.save
93 assert repository2.save
94 assert !repository2.is_default?
94 assert !repository2.is_default?
95
95
96 assert_equal repository1, Project.find(3).repository
96 assert_equal repository1, Project.find(3).repository
97 assert_equal [repository1, repository2], Project.find(3).repositories.sort
97 assert_equal [repository1, repository2], Project.find(3).repositories.sort
98 end
98 end
99
99
100 def test_default_repository_should_be_one
101 assert_equal 0, Project.find(3).repositories.count
102 repository1 = Repository::Subversion.new(
103 :project => Project.find(3),
104 :identifier => 'svn1',
105 :url => 'file:///svn1'
106 )
107 assert repository1.save
108 assert repository1.is_default?
109
110 repository2 = Repository::Subversion.new(
111 :project => Project.find(3),
112 :identifier => 'svn2',
113 :url => 'file:///svn2',
114 :is_default => true
115 )
116 assert repository2.save
117 assert repository2.is_default?
118 repository1.reload
119 assert !repository1.is_default?
120
121 assert_equal repository2, Project.find(3).repository
122 assert_equal [repository2, repository1], Project.find(3).repositories.sort
123 end
124
100 def test_identifier_should_accept_letters_digits_dashes_and_underscores
125 def test_identifier_should_accept_letters_digits_dashes_and_underscores
101 r = Repository::Subversion.new(
126 r = Repository::Subversion.new(
102 :project_id => 3,
127 :project_id => 3,
103 :identifier => 'svn-123_45',
128 :identifier => 'svn-123_45',
104 :url => 'file:///svn'
129 :url => 'file:///svn'
105 )
130 )
106 assert r.save
131 assert r.save
107 end
132 end
108
133
109 def test_identifier_should_not_be_frozen_for_a_new_repository
134 def test_identifier_should_not_be_frozen_for_a_new_repository
110 assert_equal false, Repository.new.identifier_frozen?
135 assert_equal false, Repository.new.identifier_frozen?
111 end
136 end
112
137
113 def test_identifier_should_not_be_frozen_for_a_saved_repository_with_blank_identifier
138 def test_identifier_should_not_be_frozen_for_a_saved_repository_with_blank_identifier
114 Repository.update_all(["identifier = ''"], "id = 10")
139 Repository.update_all(["identifier = ''"], "id = 10")
115
140
116 assert_equal false, Repository.find(10).identifier_frozen?
141 assert_equal false, Repository.find(10).identifier_frozen?
117 end
142 end
118
143
119 def test_identifier_should_be_frozen_for_a_saved_repository_with_valid_identifier
144 def test_identifier_should_be_frozen_for_a_saved_repository_with_valid_identifier
120 Repository.update_all(["identifier = 'abc123'"], "id = 10")
145 Repository.update_all(["identifier = 'abc123'"], "id = 10")
121
146
122 assert_equal true, Repository.find(10).identifier_frozen?
147 assert_equal true, Repository.find(10).identifier_frozen?
123 end
148 end
124
149
125 def test_identifier_should_not_accept_change_if_frozen
150 def test_identifier_should_not_accept_change_if_frozen
126 r = Repository.new(:identifier => 'foo')
151 r = Repository.new(:identifier => 'foo')
127 r.stubs(:identifier_frozen?).returns(true)
152 r.stubs(:identifier_frozen?).returns(true)
128
153
129 r.identifier = 'bar'
154 r.identifier = 'bar'
130 assert_equal 'foo', r.identifier
155 assert_equal 'foo', r.identifier
131 end
156 end
132
157
133 def test_identifier_should_accept_change_if_not_frozen
158 def test_identifier_should_accept_change_if_not_frozen
134 r = Repository.new(:identifier => 'foo')
159 r = Repository.new(:identifier => 'foo')
135 r.stubs(:identifier_frozen?).returns(false)
160 r.stubs(:identifier_frozen?).returns(false)
136
161
137 r.identifier = 'bar'
162 r.identifier = 'bar'
138 assert_equal 'bar', r.identifier
163 assert_equal 'bar', r.identifier
139 end
164 end
140
165
141 def test_destroy
166 def test_destroy
142 repository = Repository.find(10)
167 repository = Repository.find(10)
143 changesets = repository.changesets.count
168 changesets = repository.changesets.count
144 changes = repository.filechanges.count
169 changes = repository.filechanges.count
145
170
146 assert_difference 'Changeset.count', -changesets do
171 assert_difference 'Changeset.count', -changesets do
147 assert_difference 'Change.count', -changes do
172 assert_difference 'Change.count', -changes do
148 Repository.find(10).destroy
173 Repository.find(10).destroy
149 end
174 end
150 end
175 end
151 end
176 end
152
177
153 def test_destroy_should_delete_parents_associations
178 def test_destroy_should_delete_parents_associations
154 changeset = Changeset.find(102)
179 changeset = Changeset.find(102)
155 changeset.parents = Changeset.find_all_by_id([100, 101])
180 changeset.parents = Changeset.find_all_by_id([100, 101])
156 assert_difference 'Changeset.connection.select_all("select * from changeset_parents").count', -2 do
181 assert_difference 'Changeset.connection.select_all("select * from changeset_parents").count', -2 do
157 Repository.find(10).destroy
182 Repository.find(10).destroy
158 end
183 end
159 end
184 end
160
185
161 def test_destroy_should_delete_issues_associations
186 def test_destroy_should_delete_issues_associations
162 changeset = Changeset.find(102)
187 changeset = Changeset.find(102)
163 changeset.issues = Issue.find_all_by_id([1, 2])
188 changeset.issues = Issue.find_all_by_id([1, 2])
164 assert_difference 'Changeset.connection.select_all("select * from changesets_issues").count', -2 do
189 assert_difference 'Changeset.connection.select_all("select * from changesets_issues").count', -2 do
165 Repository.find(10).destroy
190 Repository.find(10).destroy
166 end
191 end
167 end
192 end
168
193
169 def test_should_not_create_with_disabled_scm
194 def test_should_not_create_with_disabled_scm
170 # disable Subversion
195 # disable Subversion
171 with_settings :enabled_scm => ['Darcs', 'Git'] do
196 with_settings :enabled_scm => ['Darcs', 'Git'] do
172 repository = Repository::Subversion.new(
197 repository = Repository::Subversion.new(
173 :project => Project.find(3), :url => "svn://localhost")
198 :project => Project.find(3), :url => "svn://localhost")
174 assert !repository.save
199 assert !repository.save
175 assert_include I18n.translate('activerecord.errors.messages.invalid'),
200 assert_include I18n.translate('activerecord.errors.messages.invalid'),
176 repository.errors[:type]
201 repository.errors[:type]
177 end
202 end
178 end
203 end
179
204
180 def test_scan_changesets_for_issue_ids
205 def test_scan_changesets_for_issue_ids
181 Setting.default_language = 'en'
206 Setting.default_language = 'en'
182
207
183 Setting.commit_ref_keywords = 'refs , references, IssueID'
208 Setting.commit_ref_keywords = 'refs , references, IssueID'
184 Setting.commit_update_keywords = [
209 Setting.commit_update_keywords = [
185 {'keywords' => 'fixes , closes', 'status_id' => IssueStatus.where(:is_closed => true).first.id, 'done_ratio' => '90'}
210 {'keywords' => 'fixes , closes', 'status_id' => IssueStatus.where(:is_closed => true).first.id, 'done_ratio' => '90'}
186 ]
211 ]
187 Setting.default_language = 'en'
212 Setting.default_language = 'en'
188 ActionMailer::Base.deliveries.clear
213 ActionMailer::Base.deliveries.clear
189
214
190 # make sure issue 1 is not already closed
215 # make sure issue 1 is not already closed
191 fixed_issue = Issue.find(1)
216 fixed_issue = Issue.find(1)
192 assert !fixed_issue.status.is_closed?
217 assert !fixed_issue.status.is_closed?
193 old_status = fixed_issue.status
218 old_status = fixed_issue.status
194
219
195 with_settings :notified_events => %w(issue_added issue_updated) do
220 with_settings :notified_events => %w(issue_added issue_updated) do
196 Repository.scan_changesets_for_issue_ids
221 Repository.scan_changesets_for_issue_ids
197 end
222 end
198 assert_equal [101, 102], Issue.find(3).changeset_ids
223 assert_equal [101, 102], Issue.find(3).changeset_ids
199
224
200 # fixed issues
225 # fixed issues
201 fixed_issue.reload
226 fixed_issue.reload
202 assert fixed_issue.status.is_closed?
227 assert fixed_issue.status.is_closed?
203 assert_equal 90, fixed_issue.done_ratio
228 assert_equal 90, fixed_issue.done_ratio
204 assert_equal [101], fixed_issue.changeset_ids
229 assert_equal [101], fixed_issue.changeset_ids
205
230
206 # issue change
231 # issue change
207 journal = fixed_issue.journals.reorder('created_on desc').first
232 journal = fixed_issue.journals.reorder('created_on desc').first
208 assert_equal User.find_by_login('dlopper'), journal.user
233 assert_equal User.find_by_login('dlopper'), journal.user
209 assert_equal 'Applied in changeset r2.', journal.notes
234 assert_equal 'Applied in changeset r2.', journal.notes
210
235
211 # 2 email notifications
236 # 2 email notifications
212 assert_equal 2, ActionMailer::Base.deliveries.size
237 assert_equal 2, ActionMailer::Base.deliveries.size
213 mail = ActionMailer::Base.deliveries.first
238 mail = ActionMailer::Base.deliveries.first
214 assert_not_nil mail
239 assert_not_nil mail
215 assert mail.subject.starts_with?(
240 assert mail.subject.starts_with?(
216 "[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]")
241 "[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]")
217 assert_mail_body_match(
242 assert_mail_body_match(
218 "Status changed from #{old_status} to #{fixed_issue.status}", mail)
243 "Status changed from #{old_status} to #{fixed_issue.status}", mail)
219
244
220 # ignoring commits referencing an issue of another project
245 # ignoring commits referencing an issue of another project
221 assert_equal [], Issue.find(4).changesets
246 assert_equal [], Issue.find(4).changesets
222 end
247 end
223
248
224 def test_for_changeset_comments_strip
249 def test_for_changeset_comments_strip
225 repository = Repository::Mercurial.create(
250 repository = Repository::Mercurial.create(
226 :project => Project.find( 4 ),
251 :project => Project.find( 4 ),
227 :url => '/foo/bar/baz' )
252 :url => '/foo/bar/baz' )
228 comment = <<-COMMENT
253 comment = <<-COMMENT
229 This is a loooooooooooooooooooooooooooong comment
254 This is a loooooooooooooooooooooooooooong comment
230
255
231
256
232 COMMENT
257 COMMENT
233 changeset = Changeset.new(
258 changeset = Changeset.new(
234 :comments => comment, :commit_date => Time.now,
259 :comments => comment, :commit_date => Time.now,
235 :revision => 0, :scmid => 'f39b7922fb3c',
260 :revision => 0, :scmid => 'f39b7922fb3c',
236 :committer => 'foo <foo@example.com>',
261 :committer => 'foo <foo@example.com>',
237 :committed_on => Time.now, :repository => repository )
262 :committed_on => Time.now, :repository => repository )
238 assert( changeset.save )
263 assert( changeset.save )
239 assert_not_equal( comment, changeset.comments )
264 assert_not_equal( comment, changeset.comments )
240 assert_equal( 'This is a loooooooooooooooooooooooooooong comment',
265 assert_equal( 'This is a loooooooooooooooooooooooooooong comment',
241 changeset.comments )
266 changeset.comments )
242 end
267 end
243
268
244 def test_for_urls_strip_cvs
269 def test_for_urls_strip_cvs
245 repository = Repository::Cvs.create(
270 repository = Repository::Cvs.create(
246 :project => Project.find(4),
271 :project => Project.find(4),
247 :url => ' :pserver:login:password@host:/path/to/the/repository',
272 :url => ' :pserver:login:password@host:/path/to/the/repository',
248 :root_url => 'foo ',
273 :root_url => 'foo ',
249 :log_encoding => 'UTF-8')
274 :log_encoding => 'UTF-8')
250 assert repository.save
275 assert repository.save
251 repository.reload
276 repository.reload
252 assert_equal ':pserver:login:password@host:/path/to/the/repository',
277 assert_equal ':pserver:login:password@host:/path/to/the/repository',
253 repository.url
278 repository.url
254 assert_equal 'foo', repository.root_url
279 assert_equal 'foo', repository.root_url
255 end
280 end
256
281
257 def test_for_urls_strip_subversion
282 def test_for_urls_strip_subversion
258 repository = Repository::Subversion.create(
283 repository = Repository::Subversion.create(
259 :project => Project.find(4),
284 :project => Project.find(4),
260 :url => ' file:///dummy ')
285 :url => ' file:///dummy ')
261 assert repository.save
286 assert repository.save
262 repository.reload
287 repository.reload
263 assert_equal 'file:///dummy', repository.url
288 assert_equal 'file:///dummy', repository.url
264 end
289 end
265
290
266 def test_for_urls_strip_git
291 def test_for_urls_strip_git
267 repository = Repository::Git.create(
292 repository = Repository::Git.create(
268 :project => Project.find(4),
293 :project => Project.find(4),
269 :url => ' c:\dummy ')
294 :url => ' c:\dummy ')
270 assert repository.save
295 assert repository.save
271 repository.reload
296 repository.reload
272 assert_equal 'c:\dummy', repository.url
297 assert_equal 'c:\dummy', repository.url
273 end
298 end
274
299
275 def test_manual_user_mapping
300 def test_manual_user_mapping
276 assert_no_difference "Changeset.where('user_id <> 2').count" do
301 assert_no_difference "Changeset.where('user_id <> 2').count" do
277 c = Changeset.create!(
302 c = Changeset.create!(
278 :repository => @repository,
303 :repository => @repository,
279 :committer => 'foo',
304 :committer => 'foo',
280 :committed_on => Time.now,
305 :committed_on => Time.now,
281 :revision => 100,
306 :revision => 100,
282 :comments => 'Committed by foo.'
307 :comments => 'Committed by foo.'
283 )
308 )
284 assert_nil c.user
309 assert_nil c.user
285 @repository.committer_ids = {'foo' => '2'}
310 @repository.committer_ids = {'foo' => '2'}
286 assert_equal User.find(2), c.reload.user
311 assert_equal User.find(2), c.reload.user
287 # committer is now mapped
312 # committer is now mapped
288 c = Changeset.create!(
313 c = Changeset.create!(
289 :repository => @repository,
314 :repository => @repository,
290 :committer => 'foo',
315 :committer => 'foo',
291 :committed_on => Time.now,
316 :committed_on => Time.now,
292 :revision => 101,
317 :revision => 101,
293 :comments => 'Another commit by foo.'
318 :comments => 'Another commit by foo.'
294 )
319 )
295 assert_equal User.find(2), c.user
320 assert_equal User.find(2), c.user
296 end
321 end
297 end
322 end
298
323
299 def test_auto_user_mapping_by_username
324 def test_auto_user_mapping_by_username
300 c = Changeset.create!(
325 c = Changeset.create!(
301 :repository => @repository,
326 :repository => @repository,
302 :committer => 'jsmith',
327 :committer => 'jsmith',
303 :committed_on => Time.now,
328 :committed_on => Time.now,
304 :revision => 100,
329 :revision => 100,
305 :comments => 'Committed by john.'
330 :comments => 'Committed by john.'
306 )
331 )
307 assert_equal User.find(2), c.user
332 assert_equal User.find(2), c.user
308 end
333 end
309
334
310 def test_auto_user_mapping_by_email
335 def test_auto_user_mapping_by_email
311 c = Changeset.create!(
336 c = Changeset.create!(
312 :repository => @repository,
337 :repository => @repository,
313 :committer => 'john <jsmith@somenet.foo>',
338 :committer => 'john <jsmith@somenet.foo>',
314 :committed_on => Time.now,
339 :committed_on => Time.now,
315 :revision => 100,
340 :revision => 100,
316 :comments => 'Committed by john.'
341 :comments => 'Committed by john.'
317 )
342 )
318 assert_equal User.find(2), c.user
343 assert_equal User.find(2), c.user
319 end
344 end
320
345
321 def test_filesystem_avaialbe
346 def test_filesystem_avaialbe
322 klass = Repository::Filesystem
347 klass = Repository::Filesystem
323 assert klass.scm_adapter_class
348 assert klass.scm_adapter_class
324 assert_equal true, klass.scm_available
349 assert_equal true, klass.scm_available
325 end
350 end
326
351
327 def test_merge_extra_info
352 def test_merge_extra_info
328 repo = Repository::Subversion.new(:project => Project.find(3))
353 repo = Repository::Subversion.new(:project => Project.find(3))
329 assert !repo.save
354 assert !repo.save
330 repo.url = "svn://localhost"
355 repo.url = "svn://localhost"
331 assert repo.save
356 assert repo.save
332 repo.reload
357 repo.reload
333 project = Project.find(3)
358 project = Project.find(3)
334 assert_equal repo, project.repository
359 assert_equal repo, project.repository
335 assert_nil repo.extra_info
360 assert_nil repo.extra_info
336 h1 = {"test_1" => {"test_11" => "test_value_11"}}
361 h1 = {"test_1" => {"test_11" => "test_value_11"}}
337 repo.merge_extra_info(h1)
362 repo.merge_extra_info(h1)
338 assert_equal h1, repo.extra_info
363 assert_equal h1, repo.extra_info
339 h2 = {"test_2" => {
364 h2 = {"test_2" => {
340 "test_21" => "test_value_21",
365 "test_21" => "test_value_21",
341 "test_22" => "test_value_22",
366 "test_22" => "test_value_22",
342 }}
367 }}
343 repo.merge_extra_info(h2)
368 repo.merge_extra_info(h2)
344 assert_equal (h = {"test_11" => "test_value_11"}),
369 assert_equal (h = {"test_11" => "test_value_11"}),
345 repo.extra_info["test_1"]
370 repo.extra_info["test_1"]
346 assert_equal "test_value_21",
371 assert_equal "test_value_21",
347 repo.extra_info["test_2"]["test_21"]
372 repo.extra_info["test_2"]["test_21"]
348 h3 = {"test_2" => {
373 h3 = {"test_2" => {
349 "test_23" => "test_value_23",
374 "test_23" => "test_value_23",
350 "test_24" => "test_value_24",
375 "test_24" => "test_value_24",
351 }}
376 }}
352 repo.merge_extra_info(h3)
377 repo.merge_extra_info(h3)
353 assert_equal (h = {"test_11" => "test_value_11"}),
378 assert_equal (h = {"test_11" => "test_value_11"}),
354 repo.extra_info["test_1"]
379 repo.extra_info["test_1"]
355 assert_nil repo.extra_info["test_2"]["test_21"]
380 assert_nil repo.extra_info["test_2"]["test_21"]
356 assert_equal "test_value_23",
381 assert_equal "test_value_23",
357 repo.extra_info["test_2"]["test_23"]
382 repo.extra_info["test_2"]["test_23"]
358 end
383 end
359
384
360 def test_sort_should_not_raise_an_error_with_nil_identifiers
385 def test_sort_should_not_raise_an_error_with_nil_identifiers
361 r1 = Repository.new
386 r1 = Repository.new
362 r2 = Repository.new
387 r2 = Repository.new
363
388
364 assert_nothing_raised do
389 assert_nothing_raised do
365 [r1, r2].sort
390 [r1, r2].sort
366 end
391 end
367 end
392 end
368 end
393 end
General Comments 0
You need to be logged in to leave comments. Login now