黄瓜:命令失败,状态(1)具有耙式功能 [英] Cucumber : Command failed with status (1) with rake features
问题描述
我使用rails 2.3.5 with
cucumber(0.10.0)
cucumber-rails(0.3.2)
capybara(0.4.1.2)
rspec .0)
rspec-core(2.5.1)
rspec-expectations(2.5.0)
rspec-mocks(2.5.0)
rspec-rails )
I am using rails 2.3.5 with cucumber (0.10.0) cucumber-rails (0.3.2) capybara (0.4.1.2) rspec (2.5.0) rspec-core (2.5.1) rspec-expectations (2.5.0) rspec-mocks (2.5.0) rspec-rails (2.5.0)
我有此方案
功能:用户登录
Scenario: User sees the admin login page
Given There exists an admin login page
When I visit the admin login page
Then she should see the "login , Password" fields
And she should see links to "Forgot Password? , Do not have an account?"
我的网页步骤
Given /^There exists an admin login page$/ do
Capybara.default_host = "admin.local"
Capybara.app_host = "http://admin.local:9887" if Capybara.current_driver == :selenium
end
When /^I visit the admin login page$/ do
visit ('/')
end
Then /^she should see the "([^"]*)" fields$/ do |fields|
fields.split(/,/).each do |field|
page.should have_xpath("//*[@id='user_session_#{field.downcase.strip}']")
end
end
Then /^she should see links to "([^"]*)"$/ do |links|
links.split(/,/).each do |link_name|
page.should have_content(link_name.strip)
end
end
我有我的管理控制台映射为一个子域,如网络步骤所示。
I have my admin console mapped as a sub domain as shown in the web steps.
我面临的问题是当我使用 cucumber-f pretty
所有步骤通过,总体情况看起来不错。
The problem that I am facing is when i run this scenario using cucumber-f pretty
all the steps pass and the overall scenario looks good.
但是当我做耙子功能或耙子黄瓜:所有我得到这个下面的错误(我发布的错误跟踪)
But when i do rake features or rake cucumber:all I get this below error ( I am posting the error with trace)
$ rake features --trace --verbose
** Invoke features (first_time)
** Invoke cucumber (first_time)
** Invoke cucumber:ok (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute cucumber:ok
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I "/Library/Ruby/Gems/1.8/gems/cucumber-0.10.0/lib:lib" "/Library/Ruby/Gems/1.8/gems/cucumber-0.10.0/bin/cucumber" --profile default
Using the default profile...
/Users/raghavendra/Projects/project/project/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
F----F
Failing Scenarios:
cucumber features/user_features/user_login_and_creation.feature:3 # Scenario: User sees the admin login page
1 scenario (1 failed)
4 steps (4 skipped)
0m0.005s
rake aborted!
Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:995:in `sh'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in `sh'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1094:in `sh'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.0/lib/cucumber/rake/task.rb:72:in `run'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.0/lib/cucumber/rake/task.rb:142:in `define_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
任何想法或帮助将非常感激:)
Any idea or help would be highly appreciated :)
推荐答案
虽然我不知道这与你的问题完全相关,但RSpec 2.x只是Rails 3.x。您将需要RSpec 1.3.x与rails 2.3.x一起使用。
While I am not sure this relates exactly to your issue, but RSpec 2.x is Rails 3.x only. You will want RSpec 1.3.x for use with rails 2.3.x.
这篇关于黄瓜:命令失败,状态(1)具有耙式功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!