Skip to content
Henrik edited this page Aug 21, 2014 · 1 revision

Run tests written with the NUnit test framework.

desc "Run all nunit tests"
nunit :test => [:build] do |cmd|
  cmd.command = "path/to/nunitconsole"
  cmd.assemblies = FileList["wildcard/path/to/assemblies"]
  cmd.results_path = "path/to/results"
  cmd.no_logo
end

Required Parameters

Command

The location of the nunit console executable.

command = "path/to/nunitconsole"

Assemblies

One or more assemblies containing [TestFixture]s for nunit to run. You can use a simple array or a Rake FileList.

assemblies = FileList["wildcard/path/to/assemblies"]

Optional Parameters

Results Path

The output path for the results XML file that NUnit always generates.

results_path = "path/to/results"

No Logo

Hide the startup banner and copyright message.

no_logo

Guidance

Standard Output & Error

You can still change the standard output and error by using the generic parameters property.

parameters = [
  "/out=nunit-output.txt",
  "/err=nunit-error.txt"
]
Clone this wiki locally