Exception running Cucumber from RubyMine, not when running from console
When I run cucumber tests with the runner options '--color -r features -p wip', I get the following error:
undefined local variable or method `runtime' for #<Teamcity::Cucumber::Formatter:0x4e353d0> (NameError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/lib/cucumber/formatter/console.rb:145:in `print_passing_wip'
C:/Program Files (x86)/JetBrains/RubyMine 6.3.3/rb/testing/patch/bdd/teamcity/cucumber/common.rb:536:in `print_summary'
C:/Program Files (x86)/JetBrains/RubyMine 6.3.3/rb/testing/patch/bdd/teamcity/cucumber/common.rb:113:in `tc_after_features'
C:/Program Files (x86)/JetBrains/RubyMine 6.3.3/rb/testing/patch/bdd/teamcity/cucumber/formatter_03103.rb:41:in `after_features'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/lib/cucumber/ast/tree_walker.rb:181:in `block in send_to_all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/lib/cucumber/ast/tree_walker.rb:179:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/lib/cucumber/ast/tree_walker.rb:179:in `send_to_all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/lib/cucumber/ast/tree_walker.rb:171:in `broadcast'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/lib/cucumber/ast/tree_walker.rb:20:in `visit_features'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/lib/cucumber/runtime.rb:49:in `run!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/lib/cucumber/cli/main.rb:47:in `execute!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.16/bin/cucumber:13:in `<top (required)>'
C:/Users/Tim/Documents/Development/Rails/tf/script/cucumber:9:in `load'
C:/Users/Tim/Documents/Development/Rails/tf/script/cucumber:9:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
When I run Cucumber from a console (with the same options) everything works fine.
My cucumber.yml is as it came out of the box:
<%
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
The offending script/cucumber file is another one I've never touched:
#!/usr/bin/env ruby
vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
if vendored_cucumber_bin
load File.expand_path(vendored_cucumber_bin)
else
require 'rubygems' unless ENV['NO_RUBYGEMS']
require 'cucumber'
load Cucumber::BINARY
end
I'm running RubyMine 6.3.3 on Windows 8.1.
How do I get Cucumber integration working correctly?
请先登录再写评论。
Hi,
it looks like a but, could you please file a ticket about it (http://youtrack.jetbrains.com/issues?q=%23ruby+%23Cucumber+) and assign it to me.
Regards, Oleg.