【问题标题】:invalid option: --autospec无效选项:--autospec
【发布时间】:2010-04-21 22:10:45
【问题描述】:
/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.

我在这里错过了什么?

【问题讨论】:

    标签: ruby-on-rails build-automation rspec cucumber autotest


    【解决方案1】:

    我终于在周末有时间自己研究一下。

    问题是 .autotest 文件中的“require 'redgreen/autotest'”语句 我将自动测试配置保存在 ~/.autotest

    评论该行,“autospec”、“autotest”和“cucumber”工作正常。

    【讨论】:

    • 它仍然是彩色输出!
    • 没试过,但你可以检查黄瓜配置文件中的-rredgreen
    【解决方案2】:

    你可以有条件地要求 redgreen

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

    您可以通过在 spec.opts 文件中传递 --color 在 rspec 中获得彩色输出

    【讨论】:

    • 我在 spec.opts 中确实有“--color”和“--color”(以防万一)选项,但它没有给我彩色规格/单位,只是给了彩色黄瓜跨度>
    猜你喜欢
    • 1970-01-01
    • 2013-04-19
    • 2011-09-27
    • 2016-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多