Skip to content

Commit

Permalink
Rely on load path for specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Mar 9, 2010
1 parent 482ddec commit 99c0692
Show file tree
Hide file tree
Showing 35 changed files with 48 additions and 59 deletions.
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -6,6 +6,7 @@ require 'spec/rake/spectask'
task :default => :spec
Spec::Rake::SpecTask.new do |t|
t.pattern = 'spec/**/*spec.rb'
t.libs << 'spec'
end

load "./treetop.gemspec"
Expand Down
4 changes: 2 additions & 2 deletions spec/compiler/and_predicate_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module AndPredicateSpec
describe "An &-predicated terminal symbol" do
Expand Down Expand Up @@ -33,4 +33,4 @@ module AndPredicateSpec
end
end
end
end
end
4 changes: 2 additions & 2 deletions spec/compiler/anything_symbol_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module AnythingSymbolSpec
class Foo < Treetop::Runtime::SyntaxNode
Expand Down Expand Up @@ -41,4 +41,4 @@ module ModFoo
end
end
end
end
end
2 changes: 1 addition & 1 deletion spec/compiler/character_class_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module CharacterClassSpec
class Foo < Treetop::Runtime::SyntaxNode
Expand Down
4 changes: 2 additions & 2 deletions spec/compiler/choice_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module ChoiceSpec
describe "A choice between terminal symbols" do
Expand Down Expand Up @@ -77,4 +77,4 @@ def a_method
end
end
end
end
end
3 changes: 2 additions & 1 deletion spec/compiler/circular_compilation_spec.rb
@@ -1,4 +1,5 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

BENCHMARK = false
METAGRAMMAR_PATH = File.expand_path('../../../lib/treetop/compiler/metagrammar.treetop', __FILE__)

Expand Down
4 changes: 2 additions & 2 deletions spec/compiler/failure_propagation_functional_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

describe "An expression for braces surrounding zero or more letters followed by semicolons" do
testing_expression "'{' ([a-z] ';')* '}'"
Expand All @@ -18,4 +18,4 @@
failure.expected_string.should == ';'
end
end
end
end
2 changes: 1 addition & 1 deletion spec/compiler/grammar_compiler_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

describe Compiler::GrammarCompiler do
attr_reader :compiler, :source_path_with_treetop_extension, :source_path_with_tt_extension, :target_path, :alternate_target_path
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/grammar_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module GrammarSpec
module Bar
Expand Down
10 changes: 1 addition & 9 deletions spec/compiler/multibyte_chars_spec.rb
@@ -1,15 +1,7 @@
#!ruby19
# encoding: utf-8

require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")

# Require ActiveSupport for multibyte strings
begin
require 'active_support'
rescue
gem 'activesupport'
require 'active_support'
end
require 'spec_helper'

module MultibyteCharsSpec
describe "an anything symbol" do
Expand Down
4 changes: 2 additions & 2 deletions spec/compiler/nonterminal_symbol_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module NonterminalSymbolSpec
describe "A nonterminal symbol followed by a block" do
Expand Down Expand Up @@ -37,4 +37,4 @@ def _nt_foo
result.should respond_to(:a_method)
end
end
end
end
4 changes: 2 additions & 2 deletions spec/compiler/not_predicate_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module NotPredicateSpec
describe "A !-predicated terminal symbol" do
Expand Down Expand Up @@ -35,4 +35,4 @@ module NotPredicateSpec
parse('abc').should be_nil
end
end
end
end
4 changes: 2 additions & 2 deletions spec/compiler/one_or_more_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module OneOrMoreSpec
class Foo < Treetop::Runtime::SyntaxNode
Expand Down Expand Up @@ -32,4 +32,4 @@ class Foo < Treetop::Runtime::SyntaxNode
end
end
end
end
end
2 changes: 1 addition & 1 deletion spec/compiler/optional_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module OptionalSpec
describe "An optional terminal symbol" do
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/parenthesized_expression_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module ParenthesizedExpressionSpec
describe "An unadorned expression inside of parentheses" do
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/parsing_rule_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module ParsingRuleSpec
describe "a grammar with one parsing rule" do
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/repeated_subrule_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module RepeatedSubruleSpec
describe "a repeated subrule" do
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/semantic_predicate_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module SemanticPredicateSpec
describe "An &-predicate block" do
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/sequence_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module SequenceSpec
class Foo < Treetop::Runtime::SyntaxNode
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/terminal_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module TerminalSymbolSpec
class Foo < Treetop::Runtime::SyntaxNode
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/terminal_symbol_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module TerminalSymbolSpec
class Foo < Treetop::Runtime::SyntaxNode
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/tt_compiler_spec.rb
Expand Up @@ -4,7 +4,7 @@
# Treetop library versions, not a previously installed gem
ENV['PATH'] = File.expand_path(File.dirname(__FILE__) + '../../../bin' +
File::PATH_SEPARATOR + ENV['PATH'])
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '../../../lib'))
$LOAD_PATH.unshift(File.expand_path('../../../../lib', __FILE__))

describe "The 'tt' comand line compiler" do

Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/zero_or_more_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module ZeroOrMoreSpec
class Foo < Treetop::Runtime::SyntaxNode
Expand Down
2 changes: 1 addition & 1 deletion spec/composition/grammar_composition_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module GrammarCompositionSpec
describe "several composed grammars" do
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby_extensions/string_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

describe String do
before do
Expand Down
2 changes: 1 addition & 1 deletion spec/runtime/compiled_parser_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module CompiledParserSpec
describe Runtime::CompiledParser, "for a grammar with two rules" do
Expand Down
4 changes: 2 additions & 2 deletions spec/runtime/interval_skip_list/delete_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
require 'runtime/interval_skip_list/spec_helper'

class IntervalSkipList
public :insert_node, :delete_node, :head, :nodes
Expand Down Expand Up @@ -144,4 +144,4 @@ class IntervalSkipList
end
end
end
end
end
4 changes: 2 additions & 2 deletions spec/runtime/interval_skip_list/expire_range_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
require 'runtime/interval_skip_list/spec_helper'

describe IntervalSkipList do
it_should_behave_like "the palindromic fixture"
Expand Down Expand Up @@ -346,4 +346,4 @@
end
end
end
end
end
2 changes: 1 addition & 1 deletion spec/runtime/interval_skip_list/insert_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
require 'runtime/interval_skip_list/spec_helper'

describe IntervalSkipList, " when #next_node_height returns 1, 3, 2, 3, 1 in order" do
include IntervalSkipListSpecHelper
Expand Down
4 changes: 2 additions & 2 deletions spec/runtime/interval_skip_list/interval_skip_list_spec.rb
@@ -1,4 +1,4 @@
#require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
#require 'runtime/interval_skip_list/spec_helper'
#
#MAX_INTERVAL = 100000
#
Expand Down Expand Up @@ -55,4 +55,4 @@
# end
# end
# end
#end
#end
5 changes: 2 additions & 3 deletions spec/runtime/interval_skip_list/palindromic_fixture_spec.rb
@@ -1,5 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
require 'runtime/interval_skip_list/spec_helper'

describe "The palindromic fixture" do
it_should_behave_like "the palindromic fixture"
Expand Down Expand Up @@ -161,4 +160,4 @@
end
end
end
end
end
4 changes: 2 additions & 2 deletions spec/runtime/interval_skip_list/spec_helper.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
require 'spec_helper'

class IntervalSkipList
public :insert_node, :delete_node, :nodes, :head, :next_node_height
Expand Down Expand Up @@ -81,4 +81,4 @@ def failure_message
end
end

require "#{File.dirname(__FILE__)}/palindromic_fixture"
require 'runtime/interval_skip_list/palindromic_fixture'
2 changes: 1 addition & 1 deletion spec/runtime/syntax_node_spec.rb
@@ -1,4 +1,4 @@
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
require 'spec_helper'

module SyntaxNodeSpec
describe "A new terminal syntax node" do
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
@@ -1,9 +1,9 @@
dir = File.dirname(__FILE__)
require 'rubygems'
require 'benchmark'
require 'spec'

require File.join(dir, '..', 'lib', 'treetop')
$LOAD_PATH.unshift File.expand_path('../../lib')
require 'treetop'
include Treetop

Spec::Runner.configure do |config|
Expand Down
4 changes: 0 additions & 4 deletions spec/spec_suite.rb

This file was deleted.

0 comments on commit 99c0692

Please sign in to comment.