On Sat, Apr 25, 2009 at 6:07 AM, Phlip <phlip2...@gmail.com> wrote:

> Cucumberists:
>
> The sample code:
>
> require 'treetop'
> require 'cucumber'
> require 'cucumber/parser'
> require 'cucumber/parser/treetop_ext'
>  # too many requires because fishing around!
>
>  include Cucumber
>  include Parser
>  include Feature
>
>  @parser = FeatureParser.new
>  exp = @parser.parse_or_fail(%{# My comment
> Feature: hi
> })
>
> The error message:
>
> NameError: undefined local variable or method
> `_nt_scenario_outline_keyword' for
> #<Cucumber::Parser::FeatureParser:0xb6f3f67c>
>    cucumber (0.3.0) lib/cucumber/parser/feature.rb:855:in
> `_nt_scenario_outline'
>    cucumber (0.3.0) lib/cucumber/parser/feature.rb:106:in `_nt_feature'
>    cucumber (0.3.0) lib/cucumber/parser/feature.rb:102:in `loop'
>    ...
>
> Okay, how do I just whip out the parser and have it parse raw Cuke code?
>

Try this:

require 'cucumber'

Cucumber.load_language('en')
p = Cucumber::Parser::FeatureParser.new
f = p.parse_or_fail <<-EOF
Feature: Foo
  Scenario: Bar
    Given Zap
EOF

Aslak


>
> --
>  Phlip
>  http://flea.sourceforge.net/resume.html
>
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to