Search code examples
ruby-on-railsrubyrspeccucumberautotest

Passing options in autospec with Cucumber in Ruby on Rails Development


I always run autospec to run features and RSpec at the same time, but running all the features is often time-consuming on my local computer. I would run every feature before committing code.

I would like to pass the argument in autospec command. autospec doesn't obviously doesn't accept the arguments directly. Here's the output of autospec -h:

    autotest [options]

options:
    -h
    -help       You're looking at it.

    -v      Be verbose.
            Prints files that autotest doesn't know how to map to
            tests.

    -q      Be more quiet.

    -f      Fast start.
            Doesn't initially run tests at start.

I do have a cucumber.yml in config directory. I also have rerun.txt in the Rails root directory. cucumber -h gives me a lot of information about arguments.

How can I run autospec against features that are tagged as @wip? I think I can make use of config/cucumber.yml. There are profile definitions. I can run cucumber -p wip to run only @wip-tagged features, but I'd like to do this with autospec.

I would appreciate any tips for working with many spec and feature files.


Solution

  • If you're on OSX, you can try using the Kicker gem to launch cucumber when files change:

    $ kicker -e "cucumber -p wip" .
    

    Unfortunately, I don't know if there's a comparable program to do arbitrary file watches on windows/linux