【问题标题】:cucumber, rspec and rails 3 raises error option: --profilecucumber、rspec 和 rails 3 引发错误选项:--profile
【发布时间】:2011-02-03 22:25:00
【问题描述】:

我第一次在 rails 3 中使用黄瓜。

宝石文件

group :test do
 gem "rspec"
 gem "rspec-rails"
 gem "database_cleaner"
 gem "spork"
 gem "cucumber",         :git => "git://github.com/aslakhellesoy/cucumber.git"
 gem "cucumber-rails",   :git => "git://github.com/aslakhellesoy/cucumber-rails.git"
 gem "capybara"
 gem "capybara-envjs"
 gem "launchy"
 gem "ruby-debug"
end

并使用发电机安装黄瓜骨架

rails generate cucumber:install --rspec --capybara

这会生成一个 cucumber.yml

<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip

如果我运行它运行的最简单的功能,但在测试后它会引发异常

$ rake cucumber
bundle exec /Users/www/.rvm/rubies/ruby-1.8.7-p330/bin/ruby -I "/Users/www/.rvm/gems/ruby-1.8.7-p330@my_app/bundler/gems/cucumber-e2df150cc4fd/lib:lib" "/Users/www/.rvm/gems/ruby-1.8.7-p330@my_app/bundler/gems/cucumber-e2df150cc4fd/bin/cucumber"  --profile default
Using the default profile...
(...)
1 scenario (1 passed)
2 steps (2 passed)
0m0.146s
invalid option: --profile
Test::Unit automatic runner.
Usage: /Users/www/.rvm/gems/ruby-1.8.7-p330@my_app/bundler/gems/cucumber-e2df150cc4fd/bin/cucumber [options] [-- untouched arguments]

我找不到这个小问题的解决方案,有什么帮助吗?

【问题讨论】:

    标签: ruby-on-rails rspec cucumber


    【解决方案1】:

    尝试使用cucumber features 或简单地使用cucumber 而不是rake cucumber

    【讨论】:

      【解决方案2】:

      尝试将此文件 features/support/minitest_disable.rb 放入以下代码:

      require 'multi_test'
      MultiTest.disable_autorun
      

      在黄瓜项目中看到这个discussion

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-12-23
        • 1970-01-01
        • 1970-01-01
        • 2013-05-28
        • 1970-01-01
        相关资源
        最近更新 更多