0

I want to be able to run a spec suite from the console. Something like described here http://interblah.net/how-minitest-works, but with specs.

No luck so far. Can someone give me a hint?

Thanks.

robertokl
  • 1,869
  • 2
  • 18
  • 28
  • you mean from irb? Or just from the shell? If you want to use specs you will have to use them. It all boils down to the same thing in minitest just the way it's written is different. – three Apr 17 '14 at 20:30

1 Answers1

1

The most direct way is to have ruby load the appropriate files and Minitest run the tests.

  1. Load the paths that have the code that needs to be accessed. This is usually the lib and test directories. Let's do this by passing -Ilib:test to ruby.
  2. Load Minitest's runner. We can do that by passing -rminitest/autorun to ruby.
  3. Load the file with the tests you want to run. Because we are requiring Minitest's runner, the tests will be run. Let's assume the test file is test/test_something.rb.

This is how that command would look:

$ ruby -Ilib:test -rminitest/autorun test/test_something.rb
blowmage
  • 8,854
  • 2
  • 35
  • 40