Project

General

Profile

Feature #27705 » 0004-Add-dependency-test.patch

Takashi Kato, 2023-08-23 15:48

View differences:

doc/RUNNING_TESTS
21 21
Before running tests, you need to configure both development
22 22
and test databases.
23 23

  
24
To test if a gem plugin is loaded, do the following
25

  
26
`export BUNDLE_GEMFILE=./test/fixtures/gem_plugins/Gemfile`
27
`bundle install`
28
`bin/rails test test/unit/lib/redmine/plugin_test.rb`
29

  
24 30
Creating test repositories
25 31
==========================
26 32

  
test/unit/lib/redmine/plugin_test.rb
80 80
    assert_equal '0.0.1', plugin.version
81 81
  end
82 82

  
83
  def test_gemified_plugin_depended_by_other_plugin
84
    skip unless gemfile_for_test?
85
    path = Redmine::PluginLoader.find_path(plugin_id: "quux_plugin", plugin_dir: nil)
86
    path.run_initializer
87
    plugin = @klass.find('quux_plugin')
88
    assert_equal :quux_plugin, plugin.id
89
  end
90

  
83 91
  def test_invalid_gemified_plugin
84 92
    skip unless gemfile_for_test?
85 93
    path = Redmine::PluginLoader.find_path(plugin_id: nil, plugin_dir: File.join(@klass.directory, 'qux_plugin'))
(5-5/6)