本文介绍了cucumber、rspec 和 rails 3 引发错误选项:--profile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我第一次在rails 3中使用黄瓜.
I used cucumber for the first time with 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
并使用发电机安装黄瓜骨架
and used the generator to install the cucumber skeleton
rails generate cucumber:install --rspec --capybara
这会生成一个 cucumber.yml
this generates a 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
如果我运行它运行的最简单的功能,但在测试后它会引发异常
if I run the simplest feature it runs through but after the test it raises an exception
$ 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]
我找不到这个小问题的解决方案,有什么帮助吗?
I can't find the solution for this little problem, any help?
推荐答案
尝试使用 cucumber features
或简单地使用 cucumber
而不是 rake cucumber
.
Try using cucumber features
or simply cucumber
instead of rake cucumber
.
这篇关于cucumber、rspec 和 rails 3 引发错误选项:--profile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!