Permalink
Browse files

Make specs use the generated metagrammar.rb so debugging the parser i…

…s easier and so there's never a mismatch between the parser that gets tested (via eval) and the parser that gets packaged (metagrammar.rb)

(cherry picked from commit d6ab4c3)
  • Loading branch information...
1 parent 0440003 commit d22299a793719f2445ecd4fdf48382e828bb2801 @jgarber jgarber committed with cjheath Jan 17, 2010
Showing with 3 additions and 4 deletions.
  1. +1 −1 spec/compiler/character_class_spec.rb
  2. +1 −0 spec/compiler/circular_compilation_spec.rb
  3. +1 −3 spec/spec_helper.rb
@@ -1,4 +1,4 @@
-require File.join(File.dirname(__FILE__), '..', 'spec_helper')
+require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
module CharacterClassSpec
class Foo < Treetop::Runtime::SyntaxNode
@@ -1,5 +1,6 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
BENCHMARK = false
+METAGRAMMAR_PATH = File.join(TREETOP_ROOT, 'compiler', 'metagrammar.treetop')
module CircularCompilationSpec
describe "a parser for the metagrammar" do
View
@@ -3,9 +3,7 @@
require 'benchmark'
require 'spec'
-unless $bootstrapped_gen_1_metagrammar
- load File.join(dir, '..', 'lib', 'treetop', 'bootstrap_gen_1_metagrammar.rb')
-end
+require File.join(dir, '..', 'lib', 'treetop')
include Treetop
Spec::Runner.configure do |config|

0 comments on commit d22299a

Please sign in to comment.