Feature #27705 » 0004-Add-dependency-test.patch
| doc/RUNNING_TESTS | ||
|---|---|---|
|
Before running tests, you need to configure both development
|
||
|
and test databases.
|
||
|
To test if a gem plugin is loaded, do the following
|
||
|
`export BUNDLE_GEMFILE=./test/fixtures/gem_plugins/Gemfile`
|
||
|
`bundle install`
|
||
|
`bin/rails test test/unit/lib/redmine/plugin_test.rb`
|
||
|
Creating test repositories
|
||
|
==========================
|
||
| test/unit/lib/redmine/plugin_test.rb | ||
|---|---|---|
|
assert_equal '0.0.1', plugin.version
|
||
|
end
|
||
|
def test_gemified_plugin_depended_by_other_plugin
|
||
|
skip unless gemfile_for_test?
|
||
|
path = Redmine::PluginLoader.find_path(plugin_id: "quux_plugin", plugin_dir: nil)
|
||
|
path.run_initializer
|
||
|
plugin = @klass.find('quux_plugin')
|
||
|
assert_equal :quux_plugin, plugin.id
|
||
|
end
|
||
|
def test_invalid_gemified_plugin
|
||
|
skip unless gemfile_for_test?
|
||
|
path = Redmine::PluginLoader.find_path(plugin_id: nil, plugin_dir: File.join(@klass.directory, 'qux_plugin'))
|
||