【发布时间】:2012-03-10 11:09:24
【问题描述】:
我什么时候遇到黄瓜这个问题。这就是一切。
我的宝石文件
source 'https://rubygems.org'
gem 'rails', '3.2.1'
gem 'pg'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :test do
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'cucumber-rails'
gem 'database_cleaner'
gem 'capybara'
end
功能测试
Feature: Requesting invitations
As a visitor
I want to request a beta invitation
So I can be sent an invitation when the site is ready
Scenario: Requesting an invitation
Given I am on the homepage
When I request and invitation for "foo@example.com"
Then I should see "Your on the list" confirmation
错误输出
Feature: Requesting invitations
As a visitor
I want to request a beta invitation
So I can be sent an invitation when the site is ready
Scenario: Requesting an invitation
Given I am on the homepage
When I request and invitation for "foo@example.com"
Then I should see "Your on the list" confirmation
rake cucumber:ok
/Users/node/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S bundle exec cucumber --profile default
Using the default profile...
Feature: Requesting invitations
As a visitor
I want to request a beta invitation
So I can be sent an invitation when the site is ready
Scenario: Requesting an invitation # features/requesting_invitations.feature:6
Deprecated: please use #source_tags instead.
Given I am on the homepage # features/requesting_invitations.feature:7
Undefined step: "I am on the homepage" (Cucumber::Undefined)
features/requesting_invitations.feature:7:in `Given I am on the homepage'
When I request and invitation for "foo@example.com" # features/requesting_invitations.feature:8
Undefined step: "I request and invitation for "foo@example.com"" (Cucumber::Undefined)
features/requesting_invitations.feature:8:in `When I request and invitation for "foo@example.com"'
Then I should see "Your on the list" confirmation # features/requesting_invitations.feature:9
Undefined step: "I should see "Your on the list" confirmation" (Cucumber::Undefined)
features/requesting_invitations.feature:9:in `Then I should see "Your on the list" confirmation'
1 scenario (1 undefined)
3 steps (3 undefined)
0m0.967s
You can implement step definitions for undefined steps with these snippets:
Given /^I am on the homepage$/ do
pending # express the regexp above with the code you wish you had
end
When /^I request and invitation for "([^"]*)"$/ do |arg1|
pending # express the regexp above with the code you wish you had
end
Then /^I should see "([^"]*)" confirmation$/ do |arg1|
pending # express the regexp above with the code you wish you had
end
rake aborted!
Command failed with status (1): [/Users/node/.rvm/rubies/ruby-1.9.2-p290/bi...]
Tasks: TOP => cucumber:ok
(See full trace by running task with --trace)
所以你可以看到,当我运行这个 rake 任务时,它会因某种原因而中断。当我运行“rake cucumber”时,我得到了同样的结果,我不知道#source_tag 是什么,也找不到关于它的文档。我该如何解决这个问题并消除错误?我认为这是一个非常直接的场景。宝石清单给出:
cucumber (1.1.8)
cucumber-rails (1.3.0)
谢谢。欢迎任何帮助。
【问题讨论】:
-
好吧想通了。我找到了这个解决方案stackoverflow.com/questions/3740523/…
-
不过,我仍然不知道弃用警告的来源。
-
好的,看起来我发现了这里有什么标签github.com/cucumber/cucumber/wiki/Tags
标签: ruby-on-rails cucumber rake