我刚刚通过以下步骤将 Cucumber 添加到我的 Rails 应用程序中:
添加
group :test do
gem 'cucumber'
end
到我的 Gemfile。
跑步bundle install
其次是rails generate cucumber:install
当没有功能时,Cucumber 似乎按预期运行。
但是当我添加一个功能文件并运行时,bundle exec cucumber
我得到以下
未初始化常量 Gherkin::Parser::Parser (NameError) /Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/feature_file.rb:34:在
parse' /Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/runtime/features_loader.rb:28:in
块中加载'/Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/runtime/features_loader.rb:26:ineach' /Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/runtime/features_loader.rb:26:in
load'/Users /purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/runtime/features_loader.rb:14:infeatures' /Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:170:in
features' /Users/purinkle/.rvm/gems /ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:46:run!' /Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in
在执行!/Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:inexecute' /Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/gems/cucumber-1.2.1/bin/cucumber:14:in
' /Users/purinkle/.rvm/ gems/ruby-1.9.3-p286@radfords/bin/cucumber:23:inload' /Users/purinkle/.rvm/gems/ruby-1.9.3-p286@radfords/bin/cucumber:23:in
'