invalid option: --autospec

不羁岁月 提交于 2019-12-12 16:25:43

问题


/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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/2686907/invalid-option-autospec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!