Passing cucumber options with Autotest and Bundler for Rails3 app
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
开发者_Go百科ree-1.8.7-2010.02@automation [~/rails_apps/automation (refactor)⚡] ➔
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
- Add
autotest: --format pretty --color --tags @wip
to your config/cucumber.yml - Restart autotest
Autotest then should pick up all scenarios tagged 'wip'. I use this quite regularly, hope this helps.
精彩评论