spec/spec_helper.rb in gisele-0.2.0 vs spec/spec_helper.rb in gisele-0.3.0
- old
+ new
@@ -10,9 +10,19 @@
ensure
$stdout, $stderr = stdout, stderr
end
module SpecHelpers
+ include Gisele::Language::AST::Helpers
+
+ def parse(text, rule, consume = true)
+ grammar = Gisele::Language::Syntax::Grammar
+ grammar.parse(text, :root => rule, :consume => consume)
+ end
+
+ def ast(text, rule, consume = true)
+ parse(text, rule, consume).to_ast
+ end
def fixtures_dir
(Path.dir/:fixtures)
end
\ No newline at end of file