Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rely on load path for specs.

  • Loading branch information...
commit 99c0692f215892c31b1a9b6d581af241ab41b20d 1 parent 482ddec
@jeremy jeremy authored
Showing with 48 additions and 59 deletions.
  1. +1 −0  Rakefile
  2. +2 −2 spec/compiler/and_predicate_spec.rb
  3. +2 −2 spec/compiler/anything_symbol_spec.rb
  4. +1 −1  spec/compiler/character_class_spec.rb
  5. +2 −2 spec/compiler/choice_spec.rb
  6. +2 −1  spec/compiler/circular_compilation_spec.rb
  7. +2 −2 spec/compiler/failure_propagation_functional_spec.rb
  8. +1 −1  spec/compiler/grammar_compiler_spec.rb
  9. +1 −1  spec/compiler/grammar_spec.rb
  10. +1 −9 spec/compiler/multibyte_chars_spec.rb
  11. +2 −2 spec/compiler/nonterminal_symbol_spec.rb
  12. +2 −2 spec/compiler/not_predicate_spec.rb
  13. +2 −2 spec/compiler/one_or_more_spec.rb
  14. +1 −1  spec/compiler/optional_spec.rb
  15. +1 −1  spec/compiler/parenthesized_expression_spec.rb
  16. +1 −1  spec/compiler/parsing_rule_spec.rb
  17. +1 −1  spec/compiler/repeated_subrule_spec.rb
  18. +1 −1  spec/compiler/semantic_predicate_spec.rb
  19. +1 −1  spec/compiler/sequence_spec.rb
  20. +1 −1  spec/compiler/terminal_spec.rb
  21. +1 −1  spec/compiler/terminal_symbol_spec.rb
  22. +1 −1  spec/compiler/tt_compiler_spec.rb
  23. +1 −1  spec/compiler/zero_or_more_spec.rb
  24. +1 −1  spec/composition/grammar_composition_spec.rb
  25. +1 −1  spec/ruby_extensions/string_spec.rb
  26. +1 −1  spec/runtime/compiled_parser_spec.rb
  27. +2 −2 spec/runtime/interval_skip_list/delete_spec.rb
  28. +2 −2 spec/runtime/interval_skip_list/expire_range_spec.rb
  29. +1 −1  spec/runtime/interval_skip_list/insert_spec.rb
  30. +2 −2 spec/runtime/interval_skip_list/interval_skip_list_spec.rb
  31. +2 −3 spec/runtime/interval_skip_list/palindromic_fixture_spec.rb
  32. +2 −2 spec/runtime/interval_skip_list/spec_helper.rb
  33. +1 −1  spec/runtime/syntax_node_spec.rb
  34. +2 −2 spec/spec_helper.rb
  35. +0 −4 spec/spec_suite.rb
View
1  Rakefile
@@ -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"
View
4 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
@@ -33,4 +33,4 @@ module AndPredicateSpec
end
end
end
-end
+end
View
4 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
@@ -41,4 +41,4 @@ module ModFoo
end
end
end
-end
+end
View
2  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
View
4 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
@@ -77,4 +77,4 @@ def a_method
end
end
end
-end
+end
View
3  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__)
View
4 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] ';')* '}'"
@@ -18,4 +18,4 @@
failure.expected_string.should == ';'
end
end
-end
+end
View
2  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
View
2  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
View
10 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
View
4 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
@@ -37,4 +37,4 @@ def _nt_foo
result.should respond_to(:a_method)
end
end
-end
+end
View
4 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
@@ -35,4 +35,4 @@ module NotPredicateSpec
parse('abc').should be_nil
end
end
-end
+end
View
4 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
@@ -32,4 +32,4 @@ class Foo < Treetop::Runtime::SyntaxNode
end
end
end
-end
+end
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  spec/compiler/tt_compiler_spec.rb
@@ -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
View
2  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
View
2  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
View
2  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
View
2  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
View
4 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
@@ -144,4 +144,4 @@ class IntervalSkipList
end
end
end
-end
+end
View
4 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"
@@ -346,4 +346,4 @@
end
end
end
-end
+end
View
2  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
View
4 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
#
@@ -55,4 +55,4 @@
# end
# end
# end
-#end
+#end
View
5 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"
@@ -161,4 +160,4 @@
end
end
end
-end
+end
View
4 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
@@ -81,4 +81,4 @@ def failure_message
end
end
-require "#{File.dirname(__FILE__)}/palindromic_fixture"
+require 'runtime/interval_skip_list/palindromic_fixture'
View
2  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
View
4 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|
View
4 spec/spec_suite.rb
@@ -1,4 +0,0 @@
-dir = File.dirname(__FILE__)
-Dir.glob("#{dir}/**/*_spec.rb") do |spec_file|
- require spec_file
-end
Please sign in to comment.
Something went wrong with that request. Please try again.