Allow plugins to define their base directory (#13927).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11766 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Baptiste Barth
2013-05-02 17:59:34 +00:00
parent 501007f01d
commit e771d68214
2 changed files with 16 additions and 5 deletions
+12
View File
@@ -83,6 +83,18 @@ class Redmine::PluginTest < ActiveSupport::TestCase
assert_nil Redmine::MenuManager.items(:project_menu).detect {|i| i.name == :foo_menu_item}
end
def test_directory_with_override
@klass.register(:foo) do
directory '/path/to/foo'
end
assert_equal '/path/to/foo', @klass.find('foo').directory
end
def test_directory_without_override
@klass.register(:foo) {}
assert_equal File.join(@klass.directory, 'foo'), @klass.find('foo').directory
end
def test_requires_redmine
plugin = Redmine::Plugin.register(:foo) {}
Redmine::VERSION.stubs(:to_a).returns([2, 1, 3, "stable", 10817])