burtlo / yard-cucumber

YARD extension that adds Cucumber Features, Tags, and Step Definitions
MIT License
128 stars 46 forks source link

Plugin does not work with Cucumber 2.0 #60

Closed jhansche closed 8 years ago

jhansche commented 9 years ago
$ bundle exec yardoc
[warn]: Error loading plugin 'yard-cucumber'
[warn]: Error loading plugin 'yard-cucumber'

The plugin can't work with a Cucumber 2.0 dependency. There are some bugs in Cucumber 1.3 that have only been fixed in 2.0 and later.

mattwynne commented 9 years ago

Can someone be specific about the issues? A backtrace would give us a place to start, but a failing automated test would be ideal. We can either make changes to Cucumber's API or help fix this plugin or both. But we need more information! :smile:

jhansche commented 9 years ago

That's all the information that I can see... I don't know how to make yardoc print a backtrace for why there was an error loading the plugin. Once I find out how to get more information, I'll try to report that here

akostadinov commented 9 years ago

Let me paste that here as well. Unfortunately yard does not print backtrace of plugins that failed to load (too bad IMO). By modifying the gem I managed to get to the issue (by modifying gem to stop requiring version 1.3):

[2] pry(main)> require 'yard-cucumber'
LoadError: cannot load such file -- cucumber/parser/gherkin_builder
from /home/avalon/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'

That's from lib/yard-cucumber.rb. @mattwynne, is that helpful?

And here's reply from @mattwynne from the other issue:

That file is gone, and has been replaced by https://github.com/cucumber/cucumber-ruby-core/blob/master/lib/cucumber/core/gherkin/ast_builder.rb

I think if yard-cucumber is going that deep, it's going to need some fundamental changes in order to work with 2.0.

I'm happy to support that effort, but it will need to be done in the yard-cucumber repo.

pghalliday commented 9 years ago

Hmm, I don't know how this is usually tested (there are no tests). However, I just commented out the offending require, updated the cucumber dependency to ~>2.0 and ran the rake task to build and serve the examples directory

bundle exec rake server

Everything seemed to run just fine without the require :s

I then rolled the dependency back to ~>1.3 and it still works fine! Does anyone know what this require 'cucumber/parser/gherkin_builder' is for?

There don't seem to be any references to GherkinBuilder in the source

azohra commented 8 years ago

@pghalliday , I pushed your changes to ruby-gems as a band-aid solution for folks who want to use yard in their projects still, without building from github.

https://rubygems.org/gems/yard-cucumber2

pghalliday commented 8 years ago

@tk8817 cool, thanks

nadimdiazramzi commented 7 years ago

Maybe this could help someone... https://cookingcode.wordpress.com/2016/10/09/how-to-install-yard-cucumber-windows/