summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-09-04 17:11:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-09-04 17:11:10 +0000
commit1e4678b9aed35f6681cabed3a73c16594224d1c7 (patch)
treeec6c170015866a767d1326565fde922ac46a2a1a /test/unit
parentc2e1dc9799900f2c5b048c94996d9ee90ce09c15 (diff)
downloadredmine-1e4678b9aed35f6681cabed3a73c16594224d1c7.tar.gz
redmine-1e4678b9aed35f6681cabed3a73c16594224d1c7.zip
Merged r15816 (#23758).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@15817 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/repository_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/repository_test.rb b/test/unit/repository_test.rb
index 238c29d64..da3273ead 100644
--- a/test/unit/repository_test.rb
+++ b/test/unit/repository_test.rb
@@ -496,4 +496,18 @@ class RepositoryTest < ActiveSupport::TestCase
Repository::Subversion.any_instance.expects(:fetch_changesets).twice.returns(true)
Repository.fetch_changesets
end
+
+ def test_repository_class
+ assert_equal Repository::Subversion, Repository.repository_class('Subversion')
+ assert_equal Repository::Git, Repository.repository_class('Git')
+ assert_nil Repository.factory('Serializer')
+ assert_nil Repository.factory('Query')
+ end
+
+ def test_factory
+ assert_instance_of Repository::Subversion, Repository.factory('Subversion')
+ assert_instance_of Repository::Git, Repository.factory('Git')
+ assert_nil Repository.factory('Serializer')
+ assert_nil Repository.factory('Query')
+ end
end