From 5a2fe67f9b320d43c84116a44e72aa019dd097dd Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 16 Nov 2010 02:48:01 +0800 Subject: [PATCH] let Rake set the load path --- Rakefile | 1 + test/api/all_features_test.rb | 2 +- test/api/cascade_test.rb | 2 +- test/api/chain_test.rb | 2 +- test/api/fallbacks_test.rb | 2 +- test/api/key_value_test.rb | 2 +- test/api/memoize_test.rb | 2 +- test/api/pluralization_test.rb | 2 +- test/api/simple_test.rb | 2 +- test/backend/cache_test.rb | 2 +- test/backend/cascade_test.rb | 2 +- test/backend/chain_test.rb | 2 +- test/backend/cldr_test.rb | 4 ++-- test/backend/exceptions_test.rb | 2 +- test/backend/fallbacks_test.rb | 2 +- test/backend/interpolation_compiler_test.rb | 2 +- test/backend/key_value_test.rb | 2 +- test/backend/memoize_test.rb | 2 +- test/backend/metadata_test.rb | 2 +- test/backend/pluralization_test.rb | 2 +- test/backend/simple_test.rb | 2 +- test/backend/transliterator_test.rb | 3 ++- test/core_ext/hash_test.rb | 2 +- test/core_ext/string/interpolate_test.rb | 2 +- test/gettext/api_test.rb | 2 +- test/gettext/backend_test.rb | 4 ++-- test/i18n_exceptions_test.rb | 2 +- test/i18n_load_path_test.rb | 2 +- test/i18n_test.rb | 2 +- test/locale/fallbacks_test.rb | 2 +- test/locale/tag/rfc4646_test.rb | 1 - test/locale/tag/simple_test.rb | 1 - test/test_helper.rb | 2 +- test/test_setup.rb | 1 - 34 files changed, 34 insertions(+), 35 deletions(-) diff --git a/Rakefile b/Rakefile index 9eb2a4b2..b50cd7a4 100644 --- a/Rakefile +++ b/Rakefile @@ -3,6 +3,7 @@ require 'rake/testtask' task :default => [:test] Rake::TestTask.new(:test) do |t| + t.libs << 'test' t.pattern = "#{File.dirname(__FILE__)}/test/all.rb" t.verbose = true end diff --git a/test/api/all_features_test.rb b/test/api/all_features_test.rb index 5ad06336..74589b7f 100644 --- a/test/api/all_features_test.rb +++ b/test/api/all_features_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' begin require 'rubygems' diff --git a/test/api/cascade_test.rb b/test/api/cascade_test.rb index 84859749..a40587b3 100644 --- a/test/api/cascade_test.rb +++ b/test/api/cascade_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nCascadeApiTest < Test::Unit::TestCase class Backend < I18n::Backend::Simple diff --git a/test/api/chain_test.rb b/test/api/chain_test.rb index a02c1c82..0a61cb0a 100644 --- a/test/api/chain_test.rb +++ b/test/api/chain_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nApiChainTest < Test::Unit::TestCase def setup diff --git a/test/api/fallbacks_test.rb b/test/api/fallbacks_test.rb index ed8f17b2..31ebb003 100644 --- a/test/api/fallbacks_test.rb +++ b/test/api/fallbacks_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nFallbacksApiTest < Test::Unit::TestCase class Backend < I18n::Backend::Simple diff --git a/test/api/key_value_test.rb b/test/api/key_value_test.rb index 213afad6..976ca6ba 100644 --- a/test/api/key_value_test.rb +++ b/test/api/key_value_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' I18n::Tests.setup_rufus_tokyo diff --git a/test/api/memoize_test.rb b/test/api/memoize_test.rb index f7fbdcf1..8839ec8c 100644 --- a/test/api/memoize_test.rb +++ b/test/api/memoize_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nMemoizeBackendWithSimpleApiTest < Test::Unit::TestCase include I18n::Tests::Basics diff --git a/test/api/pluralization_test.rb b/test/api/pluralization_test.rb index 6cd2a137..5da3a5ef 100644 --- a/test/api/pluralization_test.rb +++ b/test/api/pluralization_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nPluralizationApiTest < Test::Unit::TestCase class Backend < I18n::Backend::Simple diff --git a/test/api/simple_test.rb b/test/api/simple_test.rb index 8b5258d6..02d62058 100644 --- a/test/api/simple_test.rb +++ b/test/api/simple_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nSimpleBackendApiTest < Test::Unit::TestCase class Backend < I18n::Backend::Simple diff --git a/test/backend/cache_test.rb b/test/backend/cache_test.rb index f30be88c..39602bf3 100644 --- a/test/backend/cache_test.rb +++ b/test/backend/cache_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' begin require 'active_support' diff --git a/test/backend/cascade_test.rb b/test/backend/cascade_test.rb index 9bcb6dcb..c23f1674 100644 --- a/test/backend/cascade_test.rb +++ b/test/backend/cascade_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nBackendCascadeTest < Test::Unit::TestCase class Backend < I18n::Backend::Simple diff --git a/test/backend/chain_test.rb b/test/backend/chain_test.rb index 3b035830..e8e16d56 100644 --- a/test/backend/chain_test.rb +++ b/test/backend/chain_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nBackendChainTest < Test::Unit::TestCase def setup diff --git a/test/backend/cldr_test.rb b/test/backend/cldr_test.rb index 693fd558..7338f0a9 100644 --- a/test/backend/cldr_test.rb +++ b/test/backend/cldr_test.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../test_helper', __FILE__) +# :coding: utf-8 +require 'test_helper' if defined?(Cldr) - $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq! require 'test_helper' require 'i18n/backend/cldr' require 'date' diff --git a/test/backend/exceptions_test.rb b/test/backend/exceptions_test.rb index fe944915..fb2bb483 100644 --- a/test/backend/exceptions_test.rb +++ b/test/backend/exceptions_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nBackendExceptionsTest < Test::Unit::TestCase def setup diff --git a/test/backend/fallbacks_test.rb b/test/backend/fallbacks_test.rb index 2cf40ff0..e59637a9 100644 --- a/test/backend/fallbacks_test.rb +++ b/test/backend/fallbacks_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nBackendFallbacksTranslateTest < Test::Unit::TestCase class Backend < I18n::Backend::Simple diff --git a/test/backend/interpolation_compiler_test.rb b/test/backend/interpolation_compiler_test.rb index 1eea01d1..4af4271b 100644 --- a/test/backend/interpolation_compiler_test.rb +++ b/test/backend/interpolation_compiler_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class InterpolationCompilerTest < Test::Unit::TestCase Compiler = I18n::Backend::InterpolationCompiler::Compiler diff --git a/test/backend/key_value_test.rb b/test/backend/key_value_test.rb index 111309ca..74c6b7d1 100644 --- a/test/backend/key_value_test.rb +++ b/test/backend/key_value_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' I18n::Tests.setup_rufus_tokyo diff --git a/test/backend/memoize_test.rb b/test/backend/memoize_test.rb index 97a46a2a..a8a2e11e 100644 --- a/test/backend/memoize_test.rb +++ b/test/backend/memoize_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' require 'backend/simple_test' diff --git a/test/backend/metadata_test.rb b/test/backend/metadata_test.rb index ffe251d7..96e9f6d7 100644 --- a/test/backend/metadata_test.rb +++ b/test/backend/metadata_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nBackendMetadataTest < Test::Unit::TestCase class Backend < I18n::Backend::Simple diff --git a/test/backend/pluralization_test.rb b/test/backend/pluralization_test.rb index caf3d3e1..54fbba92 100644 --- a/test/backend/pluralization_test.rb +++ b/test/backend/pluralization_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nBackendPluralizationTest < Test::Unit::TestCase class Backend < I18n::Backend::Simple diff --git a/test/backend/simple_test.rb b/test/backend/simple_test.rb index f093f4bd..49f1a970 100644 --- a/test/backend/simple_test.rb +++ b/test/backend/simple_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' class I18nBackendSimpleTest < Test::Unit::TestCase def setup diff --git a/test/backend/transliterator_test.rb b/test/backend/transliterator_test.rb index 50d58a2e..c2e1e40b 100644 --- a/test/backend/transliterator_test.rb +++ b/test/backend/transliterator_test.rb @@ -1,4 +1,5 @@ -require File.expand_path('../../test_helper', __FILE__) +# :coding: utf-8 +require 'test_helper' class I18nBackendTransliterator < Test::Unit::TestCase def setup diff --git a/test/core_ext/hash_test.rb b/test/core_ext/hash_test.rb index 7b661c77..25c57488 100644 --- a/test/core_ext/hash_test.rb +++ b/test/core_ext/hash_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' require 'i18n/core_ext/hash' class I18nCoreExtHashInterpolationTest < Test::Unit::TestCase diff --git a/test/core_ext/string/interpolate_test.rb b/test/core_ext/string/interpolate_test.rb index 53230aeb..967a9838 100644 --- a/test/core_ext/string/interpolate_test.rb +++ b/test/core_ext/string/interpolate_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../test_helper', __FILE__) +require 'test_helper' # thanks to Masao's String extensions these should work the same in # Ruby 1.8 (patched) and Ruby 1.9 (native) diff --git a/test/gettext/api_test.rb b/test/gettext/api_test.rb index 4b8893b7..947b5a23 100644 --- a/test/gettext/api_test.rb +++ b/test/gettext/api_test.rb @@ -1,5 +1,5 @@ # encoding: utf-8 -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' require 'i18n/gettext/helpers' include I18n::Gettext::Helpers diff --git a/test/gettext/backend_test.rb b/test/gettext/backend_test.rb index 9468a7e0..ecb6e0c5 100644 --- a/test/gettext/backend_test.rb +++ b/test/gettext/backend_test.rb @@ -1,10 +1,10 @@ # encoding: utf-8 +require 'test_helper' + # apparently Ruby 1.9.1p129 has encoding problems with the gettext po parser unless RUBY_VERSION == '1.9.1' && RUBY_PATCHLEVEL <= 129 - require File.expand_path('../../test_helper', __FILE__) - class I18nGettextBackendTest < Test::Unit::TestCase include I18n::Gettext::Helpers diff --git a/test/i18n_exceptions_test.rb b/test/i18n_exceptions_test.rb index b6101ffe..fcc50f3c 100644 --- a/test/i18n_exceptions_test.rb +++ b/test/i18n_exceptions_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../test_helper', __FILE__) +require 'test_helper' class I18nExceptionsTest < Test::Unit::TestCase def test_invalid_locale_stores_locale diff --git a/test/i18n_load_path_test.rb b/test/i18n_load_path_test.rb index feb5d4d2..678c8939 100644 --- a/test/i18n_load_path_test.rb +++ b/test/i18n_load_path_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../test_helper', __FILE__) +require 'test_helper' class I18nLoadPathTest < Test::Unit::TestCase def setup diff --git a/test/i18n_test.rb b/test/i18n_test.rb index 1d1c708a..d8acca66 100644 --- a/test/i18n_test.rb +++ b/test/i18n_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../test_helper', __FILE__) +require 'test_helper' class I18nTest < Test::Unit::TestCase def setup diff --git a/test/locale/fallbacks_test.rb b/test/locale/fallbacks_test.rb index b34116ef..951016a0 100644 --- a/test/locale/fallbacks_test.rb +++ b/test/locale/fallbacks_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../test_helper', __FILE__) +require 'test_helper' include I18n::Locale diff --git a/test/locale/tag/rfc4646_test.rb b/test/locale/tag/rfc4646_test.rb index 1abb7bea..20e734ef 100644 --- a/test/locale/tag/rfc4646_test.rb +++ b/test/locale/tag/rfc4646_test.rb @@ -1,5 +1,4 @@ # encoding: utf-8 -$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../../')); $:.uniq! require 'test_helper' class I18nLocaleTagRfc4646ParserTest < Test::Unit::TestCase diff --git a/test/locale/tag/simple_test.rb b/test/locale/tag/simple_test.rb index 66f46637..ed2f76b4 100644 --- a/test/locale/tag/simple_test.rb +++ b/test/locale/tag/simple_test.rb @@ -1,5 +1,4 @@ # encoding: utf-8 -$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../../')); $:.uniq! require 'test_helper' class I18nLocaleTagSimpleTest < Test::Unit::TestCase diff --git a/test/test_helper.rb b/test/test_helper.rb index 338afd41..1eed6cf5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,4 @@ -require File.expand_path('../test_setup', __FILE__) +require 'test_setup' I18n::Tests.parse_options! diff --git a/test/test_setup.rb b/test/test_setup.rb index f0ab1291..dccda2c0 100644 --- a/test/test_setup.rb +++ b/test/test_setup.rb @@ -15,7 +15,6 @@ def gem(gem_name, *version_requirements) end require 'bundler/setup' -$:.unshift File.expand_path("../lib", File.dirname(__FILE__)) require 'i18n' require 'mocha' require 'test_declarative'