[rspec-users] [Cucumber] call the (Treetop?) parser directly?
Aslak Hellesøy
aslak.hellesoy at gmail.com
Sat Apr 25 08:51:38 EDT 2009
Den 25. april. 2009 kl. 13.10 skrev Phlip <phlip2005 at gmail.com>:
> Phlip wrote:
>> aslak hellesoy wrote:
>>> 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
>> Nope! Exact same error. Should I get the bench version? (It's 0.3.0
>> now.)
>
> That sample works in a standalone script, and does not work in a
> Rails unit test:
>
> 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.
Aslak
> --
> Phlip
> http://flea.sourceforge.net/resume.html
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
More information about the rspec-users
mailing list