[rspec-users] [Cucumber] any examples of navigating cucumber parse tree from external script

Korny Sietsma korny at sietsma.com
Tue Apr 7 21:01:01 EDT 2009

Hi folks,
I'm writing some scripts to integrate our cucumber features with stories
stored in a wiki, and I'm hoping to use cucumber's parser to parse the
features rather than doing it manually.  (I don't really care about the
feature contents much, just scenario titles and tags)

I've worked out how to parse the features:
      features = Cucumber::Ast::Features.new
      parser = Cucumber::Parser::FeatureParser.new

      feature_files = Dir["#{FEATURE_DIR}/**/*.feature"]

      feature_files.each do |f|
        puts "parsing feature file #{f}"

But now I'm digging in to the whole ast visitor thing, and it's getting
quite complex to *do* stuff with the features once I've parsed them.

I'm sure I can work this out myself, given time, but I was wondering if
there are any code examples out there to save me some of the time/effort?
Anyone else tried parsing features like this from outside Cucumber itself?


- Korny

Kornelis Sietsma  korny at my surname dot com
"Every jumbled pile of person has a thinking part
that wonders what the part that isn't thinking
isn't thinking of"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090408/5a119e83/attachment.html>

More information about the rspec-users mailing list