views:

342

answers:

2

Hi, I'm little confused on how to use cuke's options.

I know that I can run spec and cucumber in two different console. But I want it to run both. So, I can pass args/options for rspec like bundle exec autotest -c -f specdoc but if I pass cucumber options like --tags @wip --format pretty, it blows out.

So, how can I accomplish this??

ree-1.8.7-2010.02@automation [~/rails_apps/automation (refactor)⚡] ➔ bundle exec autotest -c --tags @wip
/Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1450:in `complete': invalid option: --tags (OptionParser::InvalidOption)
        from /Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1448:in `catch'
        from /Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1448:in `complete'
        from /Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1261:in `parse_in_order'
        from /Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1254:in `catch'
        from /Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
        from /Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1248:in `order!'
        from /Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1339:in `permute!'
        from /Users/millisami/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/optparse.rb:1360:in `parse!'
        from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/autotest-4.3.2/bin/autotest:6
        from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/bin/autotest:19:in `load'
        from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/bin/autotest:19
ree-1.8.7-2010.02@automation [~/rails_apps/automation (refactor)⚡] ➔ 
A: 

Options can be passed to Cucumber through cucumber.yml

For example (from the linked page), by having this in your config/cucumber.yml:

default: --format profile features
html_report: --format progress --format html --out=features_report.html features  

Don't forget to set the environment variable AUTOFEATURE to true

After that, autotest with no arguments should be all you need.

EDIT

From the Autotest Integration page:

To change the way the features are run with autotest create two profiles in your cucumber.yml:

  • autotest : Used when Autotest wants to run only the failing scenarios.
  • autotest-all : Used when Autotest wants to run all the scenarios (after a red→green transition).

For example, to turn color on when features are run, you would add the following to your cucumber.yml file:

autotest: --color
autotest-all: --color
Bryan Ash
Well, I replaced my cucumber.yml to the above as you suggested, but its not taking the effect. Here is the screenshot: http://img.skitch.com/20100803-k1q6898tdfxha2ma1923mqf7mw.pngAnd I even tried out with `default: --format pretty` as well. But no luck.
Millisami
A: 

I'm experiencing the same problem too. I've set the options for the autotest and autotest-all profiles in my cucumber.yml but they don't appear to make any difference.

schlick