diff options
Diffstat (limited to 'activesupport')
19 files changed, 41 insertions, 11 deletions
diff --git a/activesupport/test/buffered_logger_test.rb b/activesupport/test/buffered_logger_test.rb index e178ced06d..d48c7fcc54 100644 --- a/activesupport/test/buffered_logger_test.rb +++ b/activesupport/test/buffered_logger_test.rb @@ -1,6 +1,7 @@ require 'abstract_unit' require 'stringio' require 'fileutils' +require 'active_support/buffered_logger' class BufferedLoggerTest < Test::Unit::TestCase def setup diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 4e212f1661..788326c73e 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/cache' class CacheKeyTest < ActiveSupport::TestCase def test_expand_cache_key diff --git a/activesupport/test/clean_logger_test.rb b/activesupport/test/clean_logger_test.rb index 269dd2a620..6c4ec5ac46 100644 --- a/activesupport/test/clean_logger_test.rb +++ b/activesupport/test/clean_logger_test.rb @@ -1,5 +1,6 @@ require 'abstract_unit' require 'stringio' +require 'active_support/core_ext/logger' class CleanLoggerTest < Test::Unit::TestCase def setup diff --git a/activesupport/test/core_ext/cgi_ext_test.rb b/activesupport/test/core_ext/cgi_ext_test.rb index 320efd405f..c80362e382 100644 --- a/activesupport/test/core_ext/cgi_ext_test.rb +++ b/activesupport/test/core_ext/cgi_ext_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/cgi' class EscapeSkippingSlashesTest < Test::Unit::TestCase def test_array diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index 92db977a77..885393815b 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -1,4 +1,6 @@ require 'abstract_unit' +require 'active_support/core_ext/array' +require 'active_support/core_ext/enumerable' Payment = Struct.new(:price) class SummablePayment < Payment diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index d905b3d3bc..bbb1c631f9 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/hash' class HashExtTest < Test::Unit::TestCase def setup diff --git a/activesupport/test/core_ext/integer_ext_test.rb b/activesupport/test/core_ext/integer_ext_test.rb index b7006a5c86..956ae5189d 100644 --- a/activesupport/test/core_ext/integer_ext_test.rb +++ b/activesupport/test/core_ext/integer_ext_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/integer' class IntegerExtTest < Test::Unit::TestCase def test_even diff --git a/activesupport/test/core_ext/kernel_test.rb b/activesupport/test/core_ext/kernel_test.rb index e826ec161d..1dfc283268 100644 --- a/activesupport/test/core_ext/kernel_test.rb +++ b/activesupport/test/core_ext/kernel_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/kernel' class KernelTest < Test::Unit::TestCase def test_silence_warnings @@ -41,3 +42,18 @@ class KernelTest < Test::Unit::TestCase assert_equal 1, silence_stderr { 1 } end end + +class KernelSupressTest < Test::Unit::TestCase + def test_reraise + assert_raise(LoadError) do + suppress(ArgumentError) { raise LoadError } + end + end + + def test_supression + suppress(ArgumentError) { raise ArgumentError } + suppress(LoadError) { raise LoadError } + suppress(LoadError, ArgumentError) { raise LoadError } + suppress(LoadError, ArgumentError) { raise ArgumentError } + end +end diff --git a/activesupport/test/core_ext/load_error_test.rb b/activesupport/test/core_ext/load_error_test.rb index cfa8f978af..b775b65f9f 100644 --- a/activesupport/test/core_ext/load_error_test.rb +++ b/activesupport/test/core_ext/load_error_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/load_error' class TestMissingSourceFile < Test::Unit::TestCase def test_with_require diff --git a/activesupport/test/core_ext/module/synchronization_test.rb b/activesupport/test/core_ext/module/synchronization_test.rb index c28bc9b073..43d65ab249 100644 --- a/activesupport/test/core_ext/module/synchronization_test.rb +++ b/activesupport/test/core_ext/module/synchronization_test.rb @@ -1,5 +1,8 @@ require 'abstract_unit' +require 'active_support/core_ext/class/attribute_accessors' +require 'active_support/core_ext/module/synchronization' + class SynchronizationTest < Test::Unit::TestCase def setup @target = Class.new @@ -82,4 +85,4 @@ class SynchronizationTest < Test::Unit::TestCase assert_nothing_raised { @target.to_s; @target.to_s } assert_equal 2, @target.mutex.sync_count end -end
\ No newline at end of file +end diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb index 0d3d10f333..c3c696f93a 100644 --- a/activesupport/test/core_ext/module_test.rb +++ b/activesupport/test/core_ext/module_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/module' module One Constant1 = "Hello World" diff --git a/activesupport/test/core_ext/numeric_ext_test.rb b/activesupport/test/core_ext/numeric_ext_test.rb index 1beb038d56..9cca4d3aaf 100644 --- a/activesupport/test/core_ext/numeric_ext_test.rb +++ b/activesupport/test/core_ext/numeric_ext_test.rb @@ -1,5 +1,7 @@ require 'abstract_unit' +require 'active_support/core_ext/numeric/bytes' + class NumericExtTimeAndDateTimeTest < Test::Unit::TestCase def setup @now = Time.local(2005,2,10,15,30,45) diff --git a/activesupport/test/core_ext/object_and_class_ext_test.rb b/activesupport/test/core_ext/object_and_class_ext_test.rb index b6515e05a0..c919698c0f 100644 --- a/activesupport/test/core_ext/object_and_class_ext_test.rb +++ b/activesupport/test/core_ext/object_and_class_ext_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/object' class ClassA; end class ClassB < ClassA; end @@ -108,16 +109,6 @@ class ClassExtTest < Test::Unit::TestCase end class ObjectTests < Test::Unit::TestCase - def test_suppress_re_raises - assert_raise(LoadError) { suppress(ArgumentError) {raise LoadError} } - end - def test_suppress_supresses - suppress(ArgumentError) { raise ArgumentError } - suppress(LoadError) { raise LoadError } - suppress(LoadError, ArgumentError) { raise LoadError } - suppress(LoadError, ArgumentError) { raise ArgumentError } - end - def test_extended_by foo = Foo.new assert foo.extended_by.include?(Bar) diff --git a/activesupport/test/core_ext/pathname_test.rb b/activesupport/test/core_ext/pathname_test.rb index d17e8bb255..01de67251b 100644 --- a/activesupport/test/core_ext/pathname_test.rb +++ b/activesupport/test/core_ext/pathname_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/pathname' class TestPathname < Test::Unit::TestCase def test_clean_within diff --git a/activesupport/test/core_ext/range_ext_test.rb b/activesupport/test/core_ext/range_ext_test.rb index 38253d4d25..76e05e9954 100644 --- a/activesupport/test/core_ext/range_ext_test.rb +++ b/activesupport/test/core_ext/range_ext_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/range' class RangeTest < Test::Unit::TestCase def test_to_s_from_dates diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index 6c9b7e7236..fc2341c90e 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -3,6 +3,9 @@ require 'date' require 'abstract_unit' require 'inflector_test_cases' +require 'active_support/core_ext/string/conversions' +require 'active_support/core_ext/string/filters' + class StringInflectionsTest < Test::Unit::TestCase include InflectorTestCases diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb index accfe51ed6..bcb0180db6 100644 --- a/activesupport/test/core_ext/time_with_zone_test.rb +++ b/activesupport/test/core_ext/time_with_zone_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/time_with_zone' class TimeWithZoneTest < Test::Unit::TestCase diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index 7d2eedad61..9e6b4fa501 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -1,5 +1,6 @@ # encoding: utf-8 require 'abstract_unit' +require 'active_support/json' class TestJSONEncoding < Test::Unit::TestCase class Foo diff --git a/activesupport/test/option_merger_test.rb b/activesupport/test/option_merger_test.rb index f26d61617d..b898292c9c 100644 --- a/activesupport/test/option_merger_test.rb +++ b/activesupport/test/option_merger_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/object/misc' class OptionMergerTest < Test::Unit::TestCase def setup |