[rspec-users] [Cucumber] call the (Treetop?) parser directly?

Phlip phlip2005 at gmail.com
Sat Apr 25 11:00:56 EDT 2009


Aslak Hellesøy wrote:

>> require File.dirname(__FILE__) + '/../test_helper'
>>
>> class CukeFeatureParser < ActiveSupport::TestCase
>>
>>  def test_parser
>>
>> require 'cucumber'
>>
>> Cucumber.load_language('en')
>> p = Cucumber::Parser::FeatureParser.new
>> f = p.parse_or_fail <<-EOF
>> Feature: Foo
>>  Scenario: Bar
>>    Given Zap
>> EOF
>>
>>  end
>> end
>>
> 
> Please explain how it doesn't work. Output, error etc.

Same as before:

$ ruby test/unit/cuke_test.rb
Loaded suite test/unit/cuke_test
Started
E
Finished in 0.127149 seconds.

   1) Error:
test_parser(CukeFeatureParser):
NameError: undefined local variable or method `_nt_scenario_outline_keyword' for 
#<Cucumber::Parser::FeatureParser:0xb728ecc4>
     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'
     cucumber (0.3.0) lib/cucumber/parser/feature.rb:102:in `_nt_feature'
     treetop (1.2.5) lib/treetop/runtime/compiled_parser.rb:18:in `send'
     treetop (1.2.5) lib/treetop/runtime/compiled_parser.rb:18:in `parse'
     cucumber (0.3.0) lib/cucumber/parser/treetop_ext.rb:79:in `parse_or_fail'
     test/unit/cuke_test.rb:12:in `test_parser'

1 tests, 0 assertions, 0 failures, 1 errors

-- 
   Phlip
   http://flea.sourceforge.net/resume.html



More information about the rspec-users mailing list