Spec runner

How do I just invoke the spec runner through code? I have a watchr
file that I want to run the specs when files change, but I am shelling
out right now, so i though i’d speed it up by keeping it ruby. I
tried digging through the spec file, but lost while digging through
the files

Brian,

Have you tried autospec. It does almost exactly this. When used with
spork
it’s incredibly fast.


Vishu R.
co-founder thinklink llc 312.436.1627
new homepage! —> thinklinkllc.com
mocklinkr.com makes web mockups come to life
thinklinkr.com is the web-based collaborative outliner

On Nov 2, 2009, at 3:10 PM, BrianTheCoder wrote:

How do I just invoke the spec runner through code? I have a watchr
file that I want to run the specs when files change, but I am shelling
out right now, so i though i’d speed it up by keeping it ruby. I
tried digging through the spec file, but lost while digging through
the files

Spec::runner::CommandLine.run(Spec::runner::OptionParser.parse(argv,
err, out))

  • argv should be the args you would otherwise pass in on the command
    line
  • err is normally STDERR, but can be whatever you want for an error
    stream
  • out is normally STDOUT, but can be whatever you want for an output
    stream

HTH,
David