invalid option: --autospec

2019-07-04 11:09发布

/usr/local/bin/ruby -rrubygems -e "require 'redgreen'"  /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/bin/spec --autospec <files_here> -O spec/spec.opts

invalid option: --autospec
Test::Unit automatic runner.
Usage: -e [options] [-- untouched arguments]

which spec says "/usr/local/bin/spec"
which autospec says "/usr/local/bin/autospec"

/usr/local/bin/spec --help includes --autospec option in the list.

What am I missing here?

2条回答
看我几分像从前
2楼-- · 2019-07-04 11:30

I finally got some time during the weekend to look into this myself.

The problem is "require 'redgreen/autotest'" statement in .autotest file I keep my autotest configuration in ~/.autotest

Comment that row and "autospec", "autotest", and "cucumber" works ok.

查看更多
再贱就再见
3楼-- · 2019-07-04 11:38

You can just require redgreen conditionally

require 'redgreen/autotest' unless ENV['RSPEC']

You can have coloured output in rspec by passing --color in your spec.opts file

查看更多
登录 后发表回答