@@ -21,6 +21,19 begin | |||
|
21 | 21 | end |
|
22 | 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 | 37 | private |
|
25 | 38 | |
|
26 | 39 | def test_scm_version_for(scm_command_version, version) |
@@ -28,7 +28,7 class RepositoryBazaarTest < ActiveSupport::TestCase | |||
|
28 | 28 | @project = Project.find(1) |
|
29 | 29 | assert @repository = Repository::Bazaar.create(:project => @project, :url => "file:///#{REPOSITORY_PATH}") |
|
30 | 30 | end |
|
31 | ||
|
31 | ||
|
32 | 32 | if File.directory?(REPOSITORY_PATH) |
|
33 | 33 | def test_fetch_changesets_from_scratch |
|
34 | 34 | @repository.fetch_changesets |
@@ -38,7 +38,7 class RepositoryBazaarTest < ActiveSupport::TestCase | |||
|
38 | 38 | assert_equal 9, @repository.changes.count |
|
39 | 39 | assert_equal 'Initial import', @repository.changesets.find_by_revision('1').comments |
|
40 | 40 | end |
|
41 | ||
|
41 | ||
|
42 | 42 | def test_fetch_changesets_incremental |
|
43 | 43 | @repository.fetch_changesets |
|
44 | 44 | # Remove changesets with revision > 5 |
@@ -49,7 +49,7 class RepositoryBazaarTest < ActiveSupport::TestCase | |||
|
49 | 49 | @repository.fetch_changesets |
|
50 | 50 | assert_equal 4, @repository.changesets.count |
|
51 | 51 | end |
|
52 | ||
|
52 | ||
|
53 | 53 | def test_entries |
|
54 | 54 | entries = @repository.entries |
|
55 | 55 | assert_equal 2, entries.size |
@@ -68,19 +68,6 class RepositoryBazaarTest < ActiveSupport::TestCase | |||
|
68 | 68 | assert_equal 'file', entries.last.kind |
|
69 | 69 | assert_equal 'edit.png', entries.last.name |
|
70 | 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 | 71 | else |
|
85 | 72 | puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!" |
|
86 | 73 | def test_fake; assert true end |
General Comments 0
You need to be logged in to leave comments.
Login now