Commit 16f6704c authored by jplang's avatar jplang

Fixed that Repository#entries returns an Array.

git-svn-id: https://svn.redmine.org/redmine/trunk@9804 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent f146b5d7
......@@ -278,7 +278,7 @@ module Redmine
class Entries < Array
def sort_by_name
sort {|x,y|
dup.sort! {|x,y|
if x.kind == y.kind
x.name.to_s <=> y.name.to_s
else
......
......@@ -88,6 +88,7 @@ class RepositoryBazaarTest < ActiveSupport::TestCase
def test_entries
entries = @repository.entries
assert_kind_of Redmine::Scm::Adapters::Entries, entries
assert_equal 2, entries.size
assert_equal 'dir', entries[0].kind
......
......@@ -158,6 +158,7 @@ class RepositoryCvsTest < ActiveSupport::TestCase
@project.reload
assert_equal CHANGESETS_NUM, @repository.changesets.count
entries = @repository.entries('', '3')
assert_kind_of Redmine::Scm::Adapters::Entries, entries
assert_equal 3, entries.size
assert_equal entries[2].name, "README"
assert_equal entries[2].lastrev.time, Time.gm(2007, 12, 13, 16, 27, 22)
......
......@@ -88,6 +88,11 @@ class RepositoryDarcsTest < ActiveSupport::TestCase
assert_equal NUM_REV, @repository.changesets.count
end
def test_entries
entries = @repository.entries
assert_kind_of Redmine::Scm::Adapters::Entries, entries
end
def test_entries_invalid_revision
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
......
......@@ -70,7 +70,12 @@ class RepositoryFilesystemTest < ActiveSupport::TestCase
end
def test_entries
assert_equal 3, @repository.entries("", 2).size
entries = @repository.entries("", 2)
assert_kind_of Redmine::Scm::Adapters::Entries, entries
assert_equal 3, entries.size
end
def test_entries_in_directory
assert_equal 2, @repository.entries("dir", 3).size
end
......
......@@ -97,6 +97,11 @@ class RepositoryGitTest < ActiveSupport::TestCase
assert_equal true, klass.scm_available
end
def test_entries
entries = @repository.entries
assert_kind_of Redmine::Scm::Adapters::Entries, entries
end
def test_fetch_changesets_from_scratch
assert_nil @repository.extra_info
......
......@@ -81,6 +81,11 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
assert_equal true, klass.scm_available
end
def test_entries
entries = @repository.entries
assert_kind_of Redmine::Scm::Adapters::Entries, entries
end
def test_fetch_changesets_from_scratch
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
......
......@@ -56,6 +56,11 @@ class RepositorySubversionTest < ActiveSupport::TestCase
assert_equal NUM_REV, @repository.changesets.count
end
def test_entries
entries = @repository.entries
assert_kind_of Redmine::Scm::Adapters::Entries, entries
end
def test_latest_changesets
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment