Running tests
Redmine offers some rake tasks to facilitate interacting with a plugin's test suite. These tasks are shown in the following command:
$ rake -T | grep plugins:test rake redmine:plugins:test rake redmine:plugins:test:functionals rake redmine:plugins:test:integration rake redmine:plugins:test:units
Running any of these rake tasks will run the tests for all installed plugins. In order to limit the tests for our plugin, we need to provide a NAME
environment variable.
$ rake redmine:plugins:test:functionals NAME=redmine_knowledgebase Run options: # Running tests: .. Finished tests in 0.118963s, 16.8119 tests/s, 16.8119 assertions/s. 2 tests, 2 assertions, 0 failures, 0 errors, 0 skips
The rake tasks for running plugin tests are standard Rake::TestTask
instances (http://rake.rubyforge.org/classes/Rake/TestTask.html), so passing options through a TESTOPTS
environment variable will work the same as if the parameters were provided directly.
$ rake redmine:plugins:test:functionals...