@@ -103,6 +103,44 class RepositoryMercurialTest < ActiveSupport::TestCase | |||
|
103 | 103 | end |
|
104 | 104 | end |
|
105 | 105 | |
|
106 | def test_entry_on_tip | |
|
107 | entry = @repository.entry | |
|
108 | assert_kind_of Redmine::Scm::Adapters::Entry, entry | |
|
109 | assert_equal "", entry.path | |
|
110 | assert_equal 'dir', entry.kind | |
|
111 | end | |
|
112 | ||
|
113 | def test_entry_short_id | |
|
114 | ["README", "/README"].each do |path| | |
|
115 | ["0", "0885933ad4f6", "0885933ad4f68d77c2649cd11f8311276e7ef7ce"].each do |rev| | |
|
116 | entry = @repository.entry(path, rev) | |
|
117 | assert_kind_of Redmine::Scm::Adapters::Entry, entry | |
|
118 | assert_equal "README", entry.path | |
|
119 | assert_equal "file", entry.kind | |
|
120 | assert_equal '0', entry.lastrev.revision | |
|
121 | assert_equal '0885933ad4f6', entry.lastrev.identifier | |
|
122 | end | |
|
123 | end | |
|
124 | ["sources", "/sources", "/sources/"].each do |path| | |
|
125 | ["0", "0885933ad4f6", "0885933ad4f68d77c2649cd11f8311276e7ef7ce"].each do |rev| | |
|
126 | entry = @repository.entry(path, rev) | |
|
127 | assert_kind_of Redmine::Scm::Adapters::Entry, entry | |
|
128 | assert_equal "sources", entry.path | |
|
129 | assert_equal "dir", entry.kind | |
|
130 | end | |
|
131 | end | |
|
132 | ["sources/watchers_controller.rb", "/sources/watchers_controller.rb"].each do |path| | |
|
133 | ["0", "0885933ad4f6", "0885933ad4f68d77c2649cd11f8311276e7ef7ce"].each do |rev| | |
|
134 | entry = @repository.entry(path, rev) | |
|
135 | assert_kind_of Redmine::Scm::Adapters::Entry, entry | |
|
136 | assert_equal "sources/watchers_controller.rb", entry.path | |
|
137 | assert_equal "file", entry.kind | |
|
138 | assert_equal '0', entry.lastrev.revision | |
|
139 | assert_equal '0885933ad4f6', entry.lastrev.identifier | |
|
140 | end | |
|
141 | end | |
|
142 | end | |
|
143 | ||
|
106 | 144 | def test_fetch_changesets_from_scratch |
|
107 | 145 | assert_equal 0, @repository.changesets.count |
|
108 | 146 | @repository.fetch_changesets |
General Comments 0
You need to be logged in to leave comments.
Login now