guai guai - 1 year ago 82
Ruby Question

How to run all tests with minitest?

I downloaded source code for a project, found a bug, and fixed it.

Now I want to run tests to find out if I have broken anything.

The Tests are in minitest DSL.

How do I run them all at once?

I searched for applicable rake tasks etc, but I didn't find any.

Answer Source

Here's a link to Rake::TestTask.

There is an example in the page to get you started.
I'll post another one that I'm using right now for a gem:

require 'rake/testtask' do |t|
  t.pattern = "spec/*_spec.rb"

As you can see, I assume that my files are all in /lib and that my specs are in /spec and are named whatever_spec.rb

Hope it helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download