阳性标签不适用于黄瓜1.2.5

时间:2014-04-16 18:55:32

标签: ruby-on-rails ruby-on-rails-4 cucumber

我正在尝试使用标记运行功能/方案,但是当我运行标记的正版本时,我收到错误。似乎负片版本的标签工作得很好。我不确定它是否重要,但我在Windows上运行它。

当我运行bundle exec cucumber --tags @focus时,我收到了以下错误:

missing argument: --tags (OptionParser::MissingArgument)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.5/lib/cucumber/cli/options.rb:119:in `parse!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.5/lib/cucumber/cli/configuration.rb:25:in `parse!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:55:in `configuration'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:63:in `run_drb_client'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:34:in `execute!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:20:in `execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.5/bin/cucumber:14:in `<top (required)>'
C:/Ruby193/bin/cucumber:23:in `load'
C:/Ruby193/bin/cucumber:23:in `<main>'

当我运行bundle exec cucumber --tags ~@focus时,一切正常。

这是我的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

以下是我在Gemfile.rb中使用的内容:

ruby '1.9.3'
gem 'rails', '4.0.2'

gem "rspec-rails"
gem "capybara"
gem "factory_girl_rails"
gem "cucumber", "1.2.5"
gem "cucumber-rails", "1.3.0", :require => false
gem "database_cleaner"

我怀疑这个问题与配置文件有关。知道发生了什么事吗?

1 个答案:

答案 0 :(得分:1)

我在Windows上遇到了同样的问题,我通过在标记名称周围添加引号来解决此问题

bundle exec cucumber --tags '@focus'