@@ -21,6 +21,19 begin | |||||
21 | end |
|
21 | end | |
22 | end |
|
22 | end | |
23 |
|
23 | |||
|
24 | def test_cat | |||
|
25 | cat = @adapter.cat('directory/document.txt') | |||
|
26 | assert cat =~ /Write the contents of a file as of a given revision to standard output/ | |||
|
27 | end | |||
|
28 | ||||
|
29 | def test_annotate | |||
|
30 | annotate = @adapter.annotate('doc-mkdir.txt') | |||
|
31 | assert_equal 17, annotate.lines.size | |||
|
32 | assert_equal '1', annotate.revisions[0].identifier | |||
|
33 | assert_equal 'jsmith@', annotate.revisions[0].author | |||
|
34 | assert_equal 'mkdir', annotate.lines[0] | |||
|
35 | end | |||
|
36 | ||||
24 | private |
|
37 | private | |
25 |
|
38 | |||
26 | def test_scm_version_for(scm_command_version, version) |
|
39 | def test_scm_version_for(scm_command_version, version) |
@@ -28,7 +28,7 class RepositoryBazaarTest < ActiveSupport::TestCase | |||||
28 | @project = Project.find(1) |
|
28 | @project = Project.find(1) | |
29 | assert @repository = Repository::Bazaar.create(:project => @project, :url => "file:///#{REPOSITORY_PATH}") |
|
29 | assert @repository = Repository::Bazaar.create(:project => @project, :url => "file:///#{REPOSITORY_PATH}") | |
30 | end |
|
30 | end | |
31 |
|
31 | |||
32 | if File.directory?(REPOSITORY_PATH) |
|
32 | if File.directory?(REPOSITORY_PATH) | |
33 | def test_fetch_changesets_from_scratch |
|
33 | def test_fetch_changesets_from_scratch | |
34 | @repository.fetch_changesets |
|
34 | @repository.fetch_changesets | |
@@ -38,7 +38,7 class RepositoryBazaarTest < ActiveSupport::TestCase | |||||
38 | assert_equal 9, @repository.changes.count |
|
38 | assert_equal 9, @repository.changes.count | |
39 | assert_equal 'Initial import', @repository.changesets.find_by_revision('1').comments |
|
39 | assert_equal 'Initial import', @repository.changesets.find_by_revision('1').comments | |
40 | end |
|
40 | end | |
41 |
|
41 | |||
42 | def test_fetch_changesets_incremental |
|
42 | def test_fetch_changesets_incremental | |
43 | @repository.fetch_changesets |
|
43 | @repository.fetch_changesets | |
44 | # Remove changesets with revision > 5 |
|
44 | # Remove changesets with revision > 5 | |
@@ -49,7 +49,7 class RepositoryBazaarTest < ActiveSupport::TestCase | |||||
49 | @repository.fetch_changesets |
|
49 | @repository.fetch_changesets | |
50 | assert_equal 4, @repository.changesets.count |
|
50 | assert_equal 4, @repository.changesets.count | |
51 | end |
|
51 | end | |
52 |
|
52 | |||
53 | def test_entries |
|
53 | def test_entries | |
54 | entries = @repository.entries |
|
54 | entries = @repository.entries | |
55 | assert_equal 2, entries.size |
|
55 | assert_equal 2, entries.size | |
@@ -68,19 +68,6 class RepositoryBazaarTest < ActiveSupport::TestCase | |||||
68 | assert_equal 'file', entries.last.kind |
|
68 | assert_equal 'file', entries.last.kind | |
69 | assert_equal 'edit.png', entries.last.name |
|
69 | assert_equal 'edit.png', entries.last.name | |
70 | end |
|
70 | end | |
71 |
|
||||
72 | def test_cat |
|
|||
73 | cat = @repository.scm.cat('directory/document.txt') |
|
|||
74 | assert cat =~ /Write the contents of a file as of a given revision to standard output/ |
|
|||
75 | end |
|
|||
76 |
|
||||
77 | def test_annotate |
|
|||
78 | annotate = @repository.scm.annotate('doc-mkdir.txt') |
|
|||
79 | assert_equal 17, annotate.lines.size |
|
|||
80 | assert_equal '1', annotate.revisions[0].identifier |
|
|||
81 | assert_equal 'jsmith@', annotate.revisions[0].author |
|
|||
82 | assert_equal 'mkdir', annotate.lines[0] |
|
|||
83 | end |
|
|||
84 | else |
|
71 | else | |
85 | puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!" |
|
72 | puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!" | |
86 | def test_fake; assert true end |
|
73 | def test_fake; assert true end |
General Comments 0
You need to be logged in to leave comments.
Login now