Module: Rattler::Util::ParserSpecHelper
- Defined in:
- lib/rattler/util/parser_spec_helper.rb
Overview
ParserSpecHelper defines a fluent interface for writing RSpec examples for parsers.
Defined Under Namespace
Instance Method Summary collapse
-
#matching(source) ⇒ Object
Return a match result to be matched using #result_in or #fail.
-
#parsing(source) ⇒ Object
Return a parse result to be matched using #result_in or #fail.
Instance Method Details
#matching(source) ⇒ Object
Return a match result to be matched using #result_in or #fail
matching(source).as(rule_name)
matching(source).as(rule_name).from(pos)
42 43 44 |
# File 'lib/rattler/util/parser_spec_helper.rb', line 42 def matching(source) Matching.new(parser(source)) end |
#parsing(source) ⇒ Object
Return a parse result to be matched using #result_in or #fail
parsing(source)
parsing(source).from(pos)
33 34 35 |
# File 'lib/rattler/util/parser_spec_helper.rb', line 33 def parsing(source) Parsing.new(parser(source)) end |