0

我在 1.9 模式下使用 jruby 1.6.7.2 在 Rails 3 环境中运行黄瓜测试。我正在使用的命令是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'
4

2 回答 2

0

问题在这里打开并解决:

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

于 2013-02-27T19:24:07.097 回答
0

使用此命令

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

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

于 2015-01-16T12:24:14.203 回答