@@ -158,6 +158,27 class RepositoryMercurialTest < ActiveSupport::TestCase | |||
|
158 | 158 | assert c.event_title.include?('123:abc400bb8672:') |
|
159 | 159 | assert_equal 'abc400bb8672', c.event_url[:rev] |
|
160 | 160 | end |
|
161 | ||
|
162 | def test_latest_changesets_with_limit | |
|
163 | @repository.fetch_changesets | |
|
164 | @repository.reload | |
|
165 | changesets = @repository.latest_changesets('', nil, 2) | |
|
166 | assert_equal @repository.latest_changesets('', nil)[0, 2], changesets | |
|
167 | end | |
|
168 | ||
|
169 | def test_latest_changesets_with_filepath | |
|
170 | @repository.fetch_changesets | |
|
171 | @repository.reload | |
|
172 | changesets = @repository.latest_changesets('README', nil) | |
|
173 | assert_equal %w|8 6 1 0|, changesets.collect(&:revision) | |
|
174 | end | |
|
175 | ||
|
176 | def test_latest_changesets_with_dirpath | |
|
177 | @repository.fetch_changesets | |
|
178 | @repository.reload | |
|
179 | changesets = @repository.latest_changesets('images', nil) | |
|
180 | assert_equal %w|1 0|, changesets.collect(&:revision) | |
|
181 | end | |
|
161 | 182 | else |
|
162 | 183 | puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!" |
|
163 | 184 | def test_fake; assert true end |
General Comments 0
You need to be logged in to leave comments.
Login now