JUnit输出的黄瓜错误

时间:2013-02-25 16:41:35

标签: ruby-on-rails-3 junit cucumber jruby

我在Rails 3环境中运行黄瓜测试,在1.9模式下使用jruby 1.6.7.2。我使用的命令是bundle exec cucumber --format junit --out features/reports feature/test.feature

它运行该功能,然后显示错误说:

undefined method `unwrap!' for #<IO:fd 1> (NoMethodError)
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/formatter/interceptor.rb:39:in `unwrap!'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/formatter/junit.rb:67:in `after_feature'
org/jruby/RubyBasicObject.java:1704:in `__send__'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:173:in `send_to_all'
org/jruby/RubyArray.java:1615:in `each'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:171:in `send_to_all'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/features.rb:29:in `accept'
org/jruby/RubyArray.java:1615:in `each'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/features.rb:17:in `each'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/features.rb:28:in `accept'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:14:in `visit_features'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime.rb:46:in `run!'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/cli/main.rb:43:in `execute!'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/../lib/cucumber/cli/main.rb:20:in `execute'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/cucumber:14:in `(root)'
org/jruby/RubyKernel.java:1068:in `load'
/home/jenkins/.rvm/gems/jruby-1.6.7.2/gems/cucumber-1.2.1/bin/cucumber:19:in `'
org/jruby/RubyKernel.java:1088:in `eval'

2 个答案:

答案 0 :(得分:0)

问题在这里打开并解决:

https://github.com/cucumber/cucumber/issues/376

答案 1 :(得分:0)

使用此命令

cucumber features/reports feature/test.feature --format junit --out features

注意:--out功能(功能是此处的文件夹/目录)