NoMethodError:未定义的方法初始化为黄瓜:模块
我想运行一些使用耙黄瓜测试。当我打电话rake kickoff
(@kickoff是我的特性文件中的标签)我得到以下错误:NoMethodError:未定义的方法初始化为黄瓜:模块
rake aborted!
NoMethodError: undefined method `initializer' for Cucumber:Module
/webdata/jenkins/jobs/kickoff_build/workspace/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)
我已经运行了捆绑,并安装所有必要的宝石。
这里是我的kickoff_build
特征文件的内容:
@kickoff
Feature: Automated Regression Build
Scenario: As an automation developer, I want to kick off the build
Given the CI server is configured correctly
When the tag in line 1 of this file is called via a rake task
Then this test should run and pass
这里的内容我Rakefile
:
require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
require 'cuke_sniffer'
Cucumber::Rake::Task.new(:kickoff, :build) do |t|
tags = '--tags [email protected] --tags [email protected] --tags [email protected]_defect'
t.cucumber_opts = "--format html --out results/result.html --format pretty #{tags} --format junit --out features/reports"
end
这是目前在测试版黄瓜2.0.0
的错误。
升级到黄瓜~> 2.0
,你应该没问题。
哇谢谢。我现在无法测试它,因为我已经在周末结束了工作,但我会在星期一的第一件事情上测试它,并让你知道结果。 – FluffyKittens
尝试使用'rake kickoff'运行时,我也会看到同样的错误。这是由于相同的错误? – FluffyKittens
也许,我只是想消除与系统宝石的冲突作为错误来源。 – Jesper
你运行的黄瓜是什么版本? – Jesper
版本2.0.0测试版3 – FluffyKittens
你运行'bundle exec rake kickoff'还是'rake kickoff'? – Jesper