From 3f1a8dfef39ee28c1aba1f3eced06f439005c4b1 Mon Sep 17 00:00:00 2001 From: Ryan Tomayko Date: Sat, 5 Mar 2011 04:46:40 -0800 Subject: [PATCH] use consistent relative require for test/helper --- test/helper.rb | 2 +- test/suite.rb | 3 ++- test/test_basics.rb | 2 +- test/test_block_comments.rb | 2 +- test/test_comment_normalization.rb | 2 +- test/test_commentchar_detection.rb | 2 +- test/test_descriptive_section_names.rb | 2 +- test/test_language_detection.rb | 2 +- test/test_reported_issues.rb | 3 ++- test/test_skippable_lines.rb | 2 +- test/test_source_list.rb | 2 +- 11 files changed, 13 insertions(+), 11 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index 81d7128..af3d7c4 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,4 +1,4 @@ -rootdir = File.dirname(File.dirname(__FILE__)) +rootdir = File.expand_path('../../lib', __FILE__) $LOAD_PATH.unshift "#{rootdir}/lib" require 'test/unit' diff --git a/test/suite.rb b/test/suite.rb index c943985..ee5afd8 100644 --- a/test/suite.rb +++ b/test/suite.rb @@ -1,4 +1,5 @@ +require File.expand_path('../helper', __FILE__) require 'test/unit' -Dir["#{File.dirname(__FILE__)}/test_*.rb"]. +Dir[File.expand_path('../test_*.rb', __FILE__)]. each { |file| require file } diff --git a/test/test_basics.rb b/test/test_basics.rb index 8cd0fb3..40ee725 100644 --- a/test/test_basics.rb +++ b/test/test_basics.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path('../helper', __FILE__) class RoccoBasicTests < Test::Unit::TestCase def test_rocco_exists_and_is_instancable diff --git a/test/test_block_comments.rb b/test/test_block_comments.rb index 1aede51..9cfb1e9 100644 --- a/test/test_block_comments.rb +++ b/test/test_block_comments.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path('../helper', __FILE__) class RoccoBlockCommentTest < Test::Unit::TestCase def test_basics diff --git a/test/test_comment_normalization.rb b/test/test_comment_normalization.rb index d7b3f59..50f0b14 100644 --- a/test/test_comment_normalization.rb +++ b/test/test_comment_normalization.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path('../helper', __FILE__) class RoccoCommentNormalization < Test::Unit::TestCase def test_normal_comments diff --git a/test/test_commentchar_detection.rb b/test/test_commentchar_detection.rb index 46e65e6..90eb724 100644 --- a/test/test_commentchar_detection.rb +++ b/test/test_commentchar_detection.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path('../helper', __FILE__) class RoccoAutomaticCommentChars < Test::Unit::TestCase def test_basic_detection diff --git a/test/test_descriptive_section_names.rb b/test/test_descriptive_section_names.rb index 5c36e5e..9e35dec 100644 --- a/test/test_descriptive_section_names.rb +++ b/test/test_descriptive_section_names.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path('../helper', __FILE__) class RoccoDescriptiveSectionNamesTests < Test::Unit::TestCase def test_section_name diff --git a/test/test_language_detection.rb b/test/test_language_detection.rb index 92c69c4..5e2c1eb 100644 --- a/test/test_language_detection.rb +++ b/test/test_language_detection.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path('../helper', __FILE__) class RoccoLanguageDetection < Test::Unit::TestCase def test_basic_detection diff --git a/test/test_reported_issues.rb b/test/test_reported_issues.rb index 4623bbc..e94b57a 100644 --- a/test/test_reported_issues.rb +++ b/test/test_reported_issues.rb @@ -1,4 +1,5 @@ -require File.dirname(__FILE__) + '/helper' +# encoding: utf-8 +require File.expand_path('../helper', __FILE__) class RoccoIssueTests < Test::Unit::TestCase def test_issue07_incorrect_parsing_in_c_mode diff --git a/test/test_skippable_lines.rb b/test/test_skippable_lines.rb index efc9a41..88d8fe3 100644 --- a/test/test_skippable_lines.rb +++ b/test/test_skippable_lines.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path('../helper', __FILE__) class RoccoSkippableLines < Test::Unit::TestCase def test_shebang_first_line diff --git a/test/test_source_list.rb b/test/test_source_list.rb index c21fe47..06e3d61 100644 --- a/test/test_source_list.rb +++ b/test/test_source_list.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path('../helper', __FILE__) class RoccoSourceListTests < Test::Unit::TestCase def test_flat_sourcelist