mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use AS::TestCase as the base class
This commit is contained in:
parent
a2d68c1086
commit
b8d8c50785
65 changed files with 103 additions and 103 deletions
|
@ -5,7 +5,7 @@ require 'fileutils'
|
|||
require 'tempfile'
|
||||
require 'active_support/testing/deprecation'
|
||||
|
||||
class BufferedLoggerTest < Test::Unit::TestCase
|
||||
class BufferedLoggerTest < ActiveSupport::TestCase
|
||||
include MultibyteTestHelpers
|
||||
include ActiveSupport::Testing::Deprecation
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ end
|
|||
class CountingChild < CountingParent
|
||||
end
|
||||
|
||||
class BasicCallbacksTest < Test::Unit::TestCase
|
||||
class BasicCallbacksTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@index = GrandParent.new("index").dispatch
|
||||
@update = GrandParent.new("update").dispatch
|
||||
|
@ -126,7 +126,7 @@ class BasicCallbacksTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class InheritedCallbacksTest < Test::Unit::TestCase
|
||||
class InheritedCallbacksTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@index = Parent.new("index").dispatch
|
||||
@update = Parent.new("update").dispatch
|
||||
|
@ -147,7 +147,7 @@ class InheritedCallbacksTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class InheritedCallbacksTest2 < Test::Unit::TestCase
|
||||
class InheritedCallbacksTest2 < ActiveSupport::TestCase
|
||||
def setup
|
||||
@update1 = Child.new("update", :open).dispatch
|
||||
@update2 = Child.new("update", :closed).dispatch
|
||||
|
@ -162,7 +162,7 @@ class InheritedCallbacksTest2 < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class DynamicInheritedCallbacks < Test::Unit::TestCase
|
||||
class DynamicInheritedCallbacks < ActiveSupport::TestCase
|
||||
def test_callbacks_looks_to_the_superclass_before_running
|
||||
child = EmptyChild.new.dispatch
|
||||
assert !child.performed?
|
||||
|
|
|
@ -158,7 +158,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class OneTimeCompileTest < Test::Unit::TestCase
|
||||
class OneTimeCompileTest < ActiveSupport::TestCase
|
||||
def test_optimized_first_compile
|
||||
around = OneTimeCompile.new
|
||||
around.save
|
||||
|
@ -177,7 +177,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class AfterSaveConditionalPersonCallbackTest < Test::Unit::TestCase
|
||||
class AfterSaveConditionalPersonCallbackTest < ActiveSupport::TestCase
|
||||
def test_after_save_runs_in_the_reverse_order
|
||||
person = AfterSaveConditionalPerson.new
|
||||
person.save
|
||||
|
@ -345,7 +345,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class AroundCallbacksTest < Test::Unit::TestCase
|
||||
class AroundCallbacksTest < ActiveSupport::TestCase
|
||||
def test_save_around
|
||||
around = AroundPerson.new
|
||||
around.save
|
||||
|
@ -364,7 +364,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class AroundCallbackResultTest < Test::Unit::TestCase
|
||||
class AroundCallbackResultTest < ActiveSupport::TestCase
|
||||
def test_save_around
|
||||
around = AroundPersonResult.new
|
||||
around.save
|
||||
|
@ -372,7 +372,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class SkipCallbacksTest < Test::Unit::TestCase
|
||||
class SkipCallbacksTest < ActiveSupport::TestCase
|
||||
def test_skip_person
|
||||
person = PersonSkipper.new
|
||||
assert_equal [], person.history
|
||||
|
@ -391,7 +391,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class CallbacksTest < Test::Unit::TestCase
|
||||
class CallbacksTest < ActiveSupport::TestCase
|
||||
def test_save_phone
|
||||
phone = Phone.new
|
||||
assert_raise RuntimeError do
|
||||
|
@ -419,7 +419,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class ConditionalCallbackTest < Test::Unit::TestCase
|
||||
class ConditionalCallbackTest < ActiveSupport::TestCase
|
||||
def test_save_conditional_person
|
||||
person = ConditionalPerson.new
|
||||
person.save
|
||||
|
@ -437,7 +437,7 @@ module CallbacksTest
|
|||
|
||||
|
||||
|
||||
class ResetCallbackTest < Test::Unit::TestCase
|
||||
class ResetCallbackTest < ActiveSupport::TestCase
|
||||
def test_save_conditional_person
|
||||
person = CleanPerson.new
|
||||
person.save
|
||||
|
@ -567,7 +567,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class UsingObjectTest < Test::Unit::TestCase
|
||||
class UsingObjectTest < ActiveSupport::TestCase
|
||||
def test_before_object
|
||||
u = UsingObjectBefore.new
|
||||
u.save
|
||||
|
@ -592,7 +592,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class CallbackTerminatorTest < Test::Unit::TestCase
|
||||
class CallbackTerminatorTest < ActiveSupport::TestCase
|
||||
def test_termination
|
||||
terminator = CallbackTerminator.new
|
||||
terminator.save
|
||||
|
@ -612,7 +612,7 @@ module CallbacksTest
|
|||
end
|
||||
end
|
||||
|
||||
class HyphenatedKeyTest < Test::Unit::TestCase
|
||||
class HyphenatedKeyTest < ActiveSupport::TestCase
|
||||
def test_save
|
||||
obj = HyphenatedCallbacks.new
|
||||
obj.save
|
||||
|
@ -625,7 +625,7 @@ module CallbacksTest
|
|||
skip_callback :save, :before, :before_save_method, :if => lambda {self.age > 21}
|
||||
end
|
||||
|
||||
class WriterCallbacksTest < Test::Unit::TestCase
|
||||
class WriterCallbacksTest < ActiveSupport::TestCase
|
||||
def test_skip_writer
|
||||
writer = WriterSkipper.new
|
||||
writer.age = 18
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'abstract_unit'
|
|||
require 'stringio'
|
||||
require 'active_support/logger'
|
||||
|
||||
class CleanLoggerTest < Test::Unit::TestCase
|
||||
class CleanLoggerTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@out = StringIO.new
|
||||
@logger = ActiveSupport::Logger.new(@out)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/concern'
|
||||
|
||||
class ConcernTest < Test::Unit::TestCase
|
||||
class ConcernTest < ActiveSupport::TestCase
|
||||
module Baz
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ require 'active_support/core_ext/object/conversions'
|
|||
require 'active_support/core_ext' # FIXME: pulling in all to_xml extensions
|
||||
require 'active_support/hash_with_indifferent_access'
|
||||
|
||||
class ArrayExtAccessTests < Test::Unit::TestCase
|
||||
class ArrayExtAccessTests < ActiveSupport::TestCase
|
||||
def test_from
|
||||
assert_equal %w( a b c d ), %w( a b c d ).from(0)
|
||||
assert_equal %w( c d ), %w( a b c d ).from(2)
|
||||
|
@ -30,7 +30,7 @@ class ArrayExtAccessTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayExtToParamTests < Test::Unit::TestCase
|
||||
class ArrayExtToParamTests < ActiveSupport::TestCase
|
||||
class ToParam < String
|
||||
def to_param
|
||||
"#{self}1"
|
||||
|
@ -52,7 +52,7 @@ class ArrayExtToParamTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayExtToSentenceTests < Test::Unit::TestCase
|
||||
class ArrayExtToSentenceTests < ActiveSupport::TestCase
|
||||
def test_plain_array_to_sentence
|
||||
assert_equal "", [].to_sentence
|
||||
assert_equal "one", ['one'].to_sentence
|
||||
|
@ -92,7 +92,7 @@ class ArrayExtToSentenceTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayExtToSTests < Test::Unit::TestCase
|
||||
class ArrayExtToSTests < ActiveSupport::TestCase
|
||||
def test_to_s_db
|
||||
collection = [
|
||||
Class.new { def id() 1 end }.new,
|
||||
|
@ -105,7 +105,7 @@ class ArrayExtToSTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayExtGroupingTests < Test::Unit::TestCase
|
||||
class ArrayExtGroupingTests < ActiveSupport::TestCase
|
||||
def test_in_groups_of_with_perfect_fit
|
||||
groups = []
|
||||
('a'..'i').to_a.in_groups_of(3) do |group|
|
||||
|
@ -188,7 +188,7 @@ class ArrayExtGroupingTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArraySplitTests < Test::Unit::TestCase
|
||||
class ArraySplitTests < ActiveSupport::TestCase
|
||||
def test_split_with_empty_array
|
||||
assert_equal [[]], [].split(0)
|
||||
end
|
||||
|
@ -209,7 +209,7 @@ class ArraySplitTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayToXmlTests < Test::Unit::TestCase
|
||||
class ArrayToXmlTests < ActiveSupport::TestCase
|
||||
def test_to_xml
|
||||
xml = [
|
||||
{ :name => "David", :age => 26, :age_in_millis => 820497600000 },
|
||||
|
@ -299,7 +299,7 @@ class ArrayToXmlTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayExtractOptionsTests < Test::Unit::TestCase
|
||||
class ArrayExtractOptionsTests < ActiveSupport::TestCase
|
||||
class HashSubclass < Hash
|
||||
end
|
||||
|
||||
|
@ -341,7 +341,7 @@ class ArrayExtractOptionsTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayUniqByTests < Test::Unit::TestCase
|
||||
class ArrayUniqByTests < ActiveSupport::TestCase
|
||||
def test_uniq_by
|
||||
ActiveSupport::Deprecation.silence do
|
||||
assert_equal [1,2], [1,2,3,4].uniq_by { |i| i.odd? }
|
||||
|
@ -371,7 +371,7 @@ class ArrayUniqByTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayWrapperTests < Test::Unit::TestCase
|
||||
class ArrayWrapperTests < ActiveSupport::TestCase
|
||||
class FakeCollection
|
||||
def to_ary
|
||||
["foo", "bar"]
|
||||
|
@ -446,7 +446,7 @@ class ArrayWrapperTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ArrayPrependAppendTest < Test::Unit::TestCase
|
||||
class ArrayPrependAppendTest < ActiveSupport::TestCase
|
||||
def test_append
|
||||
assert_equal [1, 2], [1].append(2)
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'abstract_unit'
|
|||
require 'bigdecimal'
|
||||
require 'active_support/core_ext/big_decimal'
|
||||
|
||||
class BigDecimalTest < Test::Unit::TestCase
|
||||
class BigDecimalTest < ActiveSupport::TestCase
|
||||
def test_to_yaml
|
||||
assert_match("--- 100000.30020320320000000000000000000000000000001\n", BigDecimal.new('100000.30020320320000000000000000000000000000001').to_yaml)
|
||||
assert_match("--- .Inf\n", BigDecimal.new('Infinity').to_yaml)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
class BlankTest < Test::Unit::TestCase
|
||||
class BlankTest < ActiveSupport::TestCase
|
||||
BLANK = [ EmptyTrue.new, nil, false, '', ' ', " \n\t \r ", ' ', [], {} ]
|
||||
NOT = [ EmptyFalse.new, Object.new, true, 0, 1, 'a', [nil], { nil => 0 } ]
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/class/attribute_accessors'
|
||||
|
||||
class ClassAttributeAccessorTest < Test::Unit::TestCase
|
||||
class ClassAttributeAccessorTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@class = Class.new do
|
||||
cattr_accessor :foo
|
||||
|
|
|
@ -20,7 +20,7 @@ module DelegatingFixtures
|
|||
end
|
||||
end
|
||||
|
||||
class DelegatingAttributesTest < Test::Unit::TestCase
|
||||
class DelegatingAttributesTest < ActiveSupport::TestCase
|
||||
include DelegatingFixtures
|
||||
attr_reader :single_class
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'abstract_unit'
|
|||
require 'active_support/core_ext/class'
|
||||
require 'set'
|
||||
|
||||
class ClassTest < Test::Unit::TestCase
|
||||
class ClassTest < ActiveSupport::TestCase
|
||||
class Parent; end
|
||||
class Foo < Parent; end
|
||||
class Bar < Foo; end
|
||||
|
|
|
@ -444,7 +444,7 @@ class DateExtCalculationsTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class DateExtBehaviorTest < Test::Unit::TestCase
|
||||
class DateExtBehaviorTest < ActiveSupport::TestCase
|
||||
def test_date_acts_like_date
|
||||
assert Date.new.acts_like_date?
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/time'
|
||||
|
||||
class DateTimeExtCalculationsTest < Test::Unit::TestCase
|
||||
class DateTimeExtCalculationsTest < ActiveSupport::TestCase
|
||||
def test_to_s
|
||||
datetime = DateTime.new(2005, 2, 21, 14, 30, 0, 0)
|
||||
assert_equal "2005-02-21 14:30:00", datetime.to_s(:db)
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'bigdecimal'
|
|||
require 'active_support/core_ext/object/duplicable'
|
||||
require 'active_support/core_ext/numeric/time'
|
||||
|
||||
class DuplicableTest < Test::Unit::TestCase
|
||||
class DuplicableTest < ActiveSupport::TestCase
|
||||
RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, BigDecimal.new('4.56'), 5.seconds]
|
||||
YES = ['1', Object.new, /foo/, [], {}, Time.now]
|
||||
NO = [Class.new, Module.new]
|
||||
|
|
|
@ -7,7 +7,7 @@ class SummablePayment < Payment
|
|||
def +(p) self.class.new(price + p.price) end
|
||||
end
|
||||
|
||||
class EnumerableTests < Test::Unit::TestCase
|
||||
class EnumerableTests < ActiveSupport::TestCase
|
||||
Enumerator = [].each.class
|
||||
|
||||
class GenericEnumerable
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/file'
|
||||
|
||||
class AtomicWriteTest < Test::Unit::TestCase
|
||||
class AtomicWriteTest < ActiveSupport::TestCase
|
||||
def test_atomic_write_without_errors
|
||||
contents = "Atomic Text"
|
||||
File.atomic_write(file_name, Dir.pwd) do |file|
|
||||
|
|
|
@ -6,7 +6,7 @@ require 'active_support/ordered_hash'
|
|||
require 'active_support/core_ext/object/conversions'
|
||||
require 'active_support/inflections'
|
||||
|
||||
class HashExtTest < Test::Unit::TestCase
|
||||
class HashExtTest < ActiveSupport::TestCase
|
||||
class IndifferentHash < HashWithIndifferentAccess
|
||||
end
|
||||
|
||||
|
@ -523,7 +523,7 @@ class IWriteMyOwnXML
|
|||
end
|
||||
end
|
||||
|
||||
class HashExtToParamTests < Test::Unit::TestCase
|
||||
class HashExtToParamTests < ActiveSupport::TestCase
|
||||
class ToParam < String
|
||||
def to_param
|
||||
"#{self}-1"
|
||||
|
@ -554,7 +554,7 @@ class HashExtToParamTests < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class HashToXmlTest < Test::Unit::TestCase
|
||||
class HashToXmlTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@xml_options = { :root => :person, :skip_instruct => true, :indent => 0 }
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/integer'
|
||||
|
||||
class IntegerExtTest < Test::Unit::TestCase
|
||||
class IntegerExtTest < ActiveSupport::TestCase
|
||||
PRIME = 22953686867719691230002707821868552601124472329079
|
||||
|
||||
def test_multiple_of
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/kernel'
|
||||
|
||||
class KernelTest < Test::Unit::TestCase
|
||||
class KernelTest < ActiveSupport::TestCase
|
||||
def test_silence_warnings
|
||||
silence_warnings { assert_nil $VERBOSE }
|
||||
assert_equal 1234, silence_warnings { 1234 }
|
||||
|
@ -54,7 +54,7 @@ class KernelTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class KernelSuppressTest < Test::Unit::TestCase
|
||||
class KernelSuppressTest < ActiveSupport::TestCase
|
||||
def test_reraise
|
||||
assert_raise(LoadError) do
|
||||
suppress(ArgumentError) { raise LoadError }
|
||||
|
@ -85,7 +85,7 @@ class MockStdErr
|
|||
end
|
||||
end
|
||||
|
||||
class KernelDebuggerTest < Test::Unit::TestCase
|
||||
class KernelDebuggerTest < ActiveSupport::TestCase
|
||||
def test_debugger_not_available_message_to_stderr
|
||||
old_stderr = $stderr
|
||||
$stderr = MockStdErr.new
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/load_error'
|
||||
|
||||
class TestMissingSourceFile < Test::Unit::TestCase
|
||||
class TestMissingSourceFile < ActiveSupport::TestCase
|
||||
def test_with_require
|
||||
assert_raise(MissingSourceFile) { require 'no_this_file_don\'t_exist' }
|
||||
end
|
||||
|
@ -16,7 +16,7 @@ class TestMissingSourceFile < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class TestLoadError < Test::Unit::TestCase
|
||||
class TestLoadError < ActiveSupport::TestCase
|
||||
def test_with_require
|
||||
assert_raise(LoadError) { require 'no_this_file_don\'t_exist' }
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/module/attr_internal'
|
||||
|
||||
class AttrInternalTest < Test::Unit::TestCase
|
||||
class AttrInternalTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@target = Class.new
|
||||
@instance = @target.new
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/module/attribute_accessors'
|
||||
|
||||
class ModuleAttributeAccessorTest < Test::Unit::TestCase
|
||||
class ModuleAttributeAccessorTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
m = @module = Module.new do
|
||||
mattr_accessor :foo
|
||||
|
|
|
@ -24,7 +24,7 @@ module AttributeAliasing
|
|||
end
|
||||
end
|
||||
|
||||
class AttributeAliasingTest < Test::Unit::TestCase
|
||||
class AttributeAliasingTest < ActiveSupport::TestCase
|
||||
def test_attribute_alias
|
||||
e = AttributeAliasing::Email.new
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class Name
|
|||
end
|
||||
end
|
||||
|
||||
class ModuleTest < Test::Unit::TestCase
|
||||
class ModuleTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@david = Someone.new("David", Somewhere.new("Paulina", "Chicago"))
|
||||
end
|
||||
|
@ -245,7 +245,7 @@ module BarMethods
|
|||
end
|
||||
end
|
||||
|
||||
class MethodAliasingTest < Test::Unit::TestCase
|
||||
class MethodAliasingTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
Object.const_set :FooClassWithBarMethod, Class.new { def bar() 'bar' end }
|
||||
@instance = FooClassWithBarMethod.new
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/name_error'
|
||||
|
||||
class NameErrorTest < Test::Unit::TestCase
|
||||
class NameErrorTest < ActiveSupport::TestCase
|
||||
def test_name_error_should_set_missing_name
|
||||
SomeNameThatNobodyWillUse____Really ? 1 : 0
|
||||
flunk "?!?!"
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'active_support/time'
|
|||
require 'active_support/core_ext/numeric'
|
||||
require 'active_support/core_ext/integer'
|
||||
|
||||
class NumericExtTimeAndDateTimeTest < Test::Unit::TestCase
|
||||
class NumericExtTimeAndDateTimeTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@now = Time.local(2005,2,10,15,30,45)
|
||||
@dtnow = DateTime.civil(2005,2,10,15,30,45)
|
||||
|
@ -128,7 +128,7 @@ class NumericExtTimeAndDateTimeTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class NumericExtDateTest < Test::Unit::TestCase
|
||||
class NumericExtDateTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@today = Date.today
|
||||
end
|
||||
|
@ -151,7 +151,7 @@ class NumericExtDateTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class NumericExtSizeTest < Test::Unit::TestCase
|
||||
class NumericExtSizeTest < ActiveSupport::TestCase
|
||||
def test_unit_in_terms_of_another
|
||||
relationships = {
|
||||
1024.bytes => 1.kilobyte,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/object/inclusion'
|
||||
|
||||
class InTest < Test::Unit::TestCase
|
||||
class InTest < ActiveSupport::TestCase
|
||||
def test_in_multiple_args
|
||||
assert :b.in?(:a,:b)
|
||||
assert !:c.in?(:a,:b)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/object/to_param'
|
||||
|
||||
class ToParamTest < Test::Unit::TestCase
|
||||
class ToParamTest < ActiveSupport::TestCase
|
||||
def test_object
|
||||
foo = Object.new
|
||||
def foo.to_s; 'foo' end
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'active_support/ordered_hash'
|
|||
require 'active_support/core_ext/object/to_query'
|
||||
require 'active_support/core_ext/string/output_safety.rb'
|
||||
|
||||
class ToQueryTest < Test::Unit::TestCase
|
||||
class ToQueryTest < ActiveSupport::TestCase
|
||||
def test_simple_conversion
|
||||
assert_query_equal 'a=10', :a => 10
|
||||
end
|
||||
|
|
|
@ -59,7 +59,7 @@ class ObjectTests < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ObjectInstanceVariableTest < Test::Unit::TestCase
|
||||
class ObjectInstanceVariableTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@source, @dest = Object.new, Object.new
|
||||
@source.instance_variable_set(:@bar, 'bar')
|
||||
|
@ -91,7 +91,7 @@ class ObjectInstanceVariableTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ObjectTryTest < Test::Unit::TestCase
|
||||
class ObjectTryTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@string = "Hello"
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/proc'
|
||||
|
||||
class ProcTests < Test::Unit::TestCase
|
||||
class ProcTests < ActiveSupport::TestCase
|
||||
def test_bind_returns_method_with_changed_self
|
||||
block = Proc.new { self }
|
||||
assert_equal self, block.call
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'abstract_unit'
|
|||
require 'active_support/time'
|
||||
require 'active_support/core_ext/range'
|
||||
|
||||
class RangeTest < Test::Unit::TestCase
|
||||
class RangeTest < ActiveSupport::TestCase
|
||||
def test_to_s_from_dates
|
||||
date_range = Date.new(2005, 12, 10)..Date.new(2005, 12, 12)
|
||||
assert_equal "BETWEEN '2005-12-10' AND '2005-12-12'", date_range.to_s(:db)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/regexp'
|
||||
|
||||
class RegexpExtAccessTests < Test::Unit::TestCase
|
||||
class RegexpExtAccessTests < ActiveSupport::TestCase
|
||||
def test_multiline
|
||||
assert_equal true, //m.multiline?
|
||||
assert_equal false, //.multiline?
|
||||
|
|
|
@ -17,7 +17,7 @@ module Ace
|
|||
end
|
||||
end
|
||||
|
||||
class StringInflectionsTest < Test::Unit::TestCase
|
||||
class StringInflectionsTest < ActiveSupport::TestCase
|
||||
include InflectorTestCases
|
||||
include ConstantizeTestCases
|
||||
|
||||
|
@ -297,7 +297,7 @@ class StringInflectionsTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class StringBehaviourTest < Test::Unit::TestCase
|
||||
class StringBehaviourTest < ActiveSupport::TestCase
|
||||
def test_acts_like_string
|
||||
assert 'Bambi'.acts_like_string?
|
||||
end
|
||||
|
|
|
@ -834,7 +834,7 @@ class TimeExtCalculationsTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class TimeExtMarshalingTest < Test::Unit::TestCase
|
||||
class TimeExtMarshalingTest < ActiveSupport::TestCase
|
||||
def test_marshaling_with_utc_instance
|
||||
t = Time.utc(2000)
|
||||
unmarshaled = Marshal.load(Marshal.dump(t))
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'abstract_unit'
|
|||
require 'active_support/time'
|
||||
require 'active_support/json'
|
||||
|
||||
class TimeWithZoneTest < Test::Unit::TestCase
|
||||
class TimeWithZoneTest < ActiveSupport::TestCase
|
||||
|
||||
def setup
|
||||
@utc = Time.utc(2000, 1, 1, 0)
|
||||
|
@ -736,7 +736,7 @@ class TimeWithZoneTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class TimeWithZoneMethodsForTimeAndDateTimeTest < Test::Unit::TestCase
|
||||
class TimeWithZoneMethodsForTimeAndDateTimeTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@t, @dt = Time.utc(2000), DateTime.civil(2000)
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'abstract_unit'
|
|||
require 'uri'
|
||||
require 'active_support/core_ext/uri'
|
||||
|
||||
class URIExtTest < Test::Unit::TestCase
|
||||
class URIExtTest < ActiveSupport::TestCase
|
||||
def test_uri_decode_handle_multibyte
|
||||
str = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E" # Ni-ho-nn-go in UTF-8, means Japanese.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ module ModuleWithConstant
|
|||
InheritedConstant = "Hello"
|
||||
end
|
||||
|
||||
class DependenciesTest < Test::Unit::TestCase
|
||||
class DependenciesTest < ActiveSupport::TestCase
|
||||
def teardown
|
||||
ActiveSupport::Dependencies.clear
|
||||
end
|
||||
|
@ -413,7 +413,7 @@ class DependenciesTest < Test::Unit::TestCase
|
|||
assert ActiveSupport::Dependencies.qualified_const_defined?("Object")
|
||||
assert ActiveSupport::Dependencies.qualified_const_defined?("::Object")
|
||||
assert ActiveSupport::Dependencies.qualified_const_defined?("::Object::Kernel")
|
||||
assert ActiveSupport::Dependencies.qualified_const_defined?("::Test::Unit::TestCase")
|
||||
assert ActiveSupport::Dependencies.qualified_const_defined?("::ActiveSupport::TestCase")
|
||||
end
|
||||
|
||||
def test_qualified_const_defined_should_not_call_const_missing
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/deprecation'
|
||||
|
||||
class ProxyWrappersTest < Test::Unit::TestCase
|
||||
class ProxyWrappersTest < ActiveSupport::TestCase
|
||||
Waffles = false
|
||||
NewWaffles = :hamburgers
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'active_support/descendants_tracker'
|
|||
require 'active_support/dependencies'
|
||||
require 'descendants_tracker_test_cases'
|
||||
|
||||
class DescendantsTrackerWithAutoloadingTest < Test::Unit::TestCase
|
||||
class DescendantsTrackerWithAutoloadingTest < ActiveSupport::TestCase
|
||||
include DescendantsTrackerTestCases
|
||||
|
||||
def test_clear_with_autoloaded_parent_children_and_granchildren
|
||||
|
|
|
@ -3,6 +3,6 @@ require 'test/unit'
|
|||
require 'active_support/descendants_tracker'
|
||||
require 'descendants_tracker_test_cases'
|
||||
|
||||
class DescendantsTrackerWithoutAutoloadingTest < Test::Unit::TestCase
|
||||
class DescendantsTrackerWithoutAutoloadingTest < ActiveSupport::TestCase
|
||||
include DescendantsTrackerTestCases
|
||||
end
|
|
@ -4,7 +4,7 @@ require 'fileutils'
|
|||
|
||||
MTIME_FIXTURES_PATH = File.expand_path("../fixtures", __FILE__)
|
||||
|
||||
class FileUpdateCheckerWithEnumerableTest < Test::Unit::TestCase
|
||||
class FileUpdateCheckerWithEnumerableTest < ActiveSupport::TestCase
|
||||
FILES = %w(1.txt 2.txt 3.txt)
|
||||
|
||||
def setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
class GzipTest < Test::Unit::TestCase
|
||||
class GzipTest < ActiveSupport::TestCase
|
||||
def test_compress_should_decompress_to_the_same_value
|
||||
assert_equal "Hello World", ActiveSupport::Gzip.decompress(ActiveSupport::Gzip.compress("Hello World"))
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'abstract_unit'
|
|||
require 'active_support/time'
|
||||
require 'active_support/core_ext/array/conversions'
|
||||
|
||||
class I18nTest < Test::Unit::TestCase
|
||||
class I18nTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@date = Date.parse("2008-7-2")
|
||||
@time = Time.utc(2008, 7, 2, 16, 47, 1)
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'active_support/inflector'
|
|||
require 'inflector_test_cases'
|
||||
require 'constantize_test_cases'
|
||||
|
||||
class InflectorTest < Test::Unit::TestCase
|
||||
class InflectorTest < ActiveSupport::TestCase
|
||||
include InflectorTestCases
|
||||
include ConstantizeTestCases
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'abstract_unit'
|
|||
require 'active_support/core_ext/string/inflections'
|
||||
require 'active_support/json'
|
||||
|
||||
class TestJSONEncoding < Test::Unit::TestCase
|
||||
class TestJSONEncoding < ActiveSupport::TestCase
|
||||
class Foo
|
||||
def initialize(a, b)
|
||||
@a, @b = a, b
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'abstract_unit'
|
||||
|
||||
class LoadPathsTest < Test::Unit::TestCase
|
||||
class LoadPathsTest < ActiveSupport::TestCase
|
||||
def test_uniq_load_paths
|
||||
load_paths_count = $LOAD_PATH.inject({}) { |paths, path|
|
||||
expanded_path = File.expand_path(path)
|
||||
|
|
|
@ -10,7 +10,7 @@ class String
|
|||
def __method_for_multibyte_testing_that_returns_nil!; end
|
||||
end
|
||||
|
||||
class MultibyteCharsTest < Test::Unit::TestCase
|
||||
class MultibyteCharsTest < ActiveSupport::TestCase
|
||||
include MultibyteTestHelpers
|
||||
|
||||
def setup
|
||||
|
@ -90,7 +90,7 @@ class MultibyteCharsTest < Test::Unit::TestCase
|
|||
|
||||
end
|
||||
|
||||
class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
|
||||
class MultibyteCharsUTF8BehaviourTest < ActiveSupport::TestCase
|
||||
include MultibyteTestHelpers
|
||||
|
||||
def setup
|
||||
|
@ -457,7 +457,7 @@ end
|
|||
# The default Multibyte Chars proxy has more features than the normal string implementation. Tests
|
||||
# for the implementation of these features should run on all Ruby versions and shouldn't be tested
|
||||
# through the proxy methods.
|
||||
class MultibyteCharsExtrasTest < Test::Unit::TestCase
|
||||
class MultibyteCharsExtrasTest < ActiveSupport::TestCase
|
||||
include MultibyteTestHelpers
|
||||
|
||||
def test_upcase_should_be_unicode_aware
|
||||
|
|
|
@ -25,7 +25,7 @@ class Downloader
|
|||
end
|
||||
end
|
||||
|
||||
class MultibyteConformanceTest < Test::Unit::TestCase
|
||||
class MultibyteConformanceTest < ActiveSupport::TestCase
|
||||
include MultibyteTestHelpers
|
||||
|
||||
UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
require 'abstract_unit'
|
||||
|
||||
|
||||
class MultibyteUnicodeDatabaseTest < Test::Unit::TestCase
|
||||
class MultibyteUnicodeDatabaseTest < ActiveSupport::TestCase
|
||||
|
||||
include ActiveSupport::Multibyte::Unicode
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/object/with_options'
|
||||
|
||||
class OptionMergerTest < Test::Unit::TestCase
|
||||
class OptionMergerTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@options = {:hello => 'world'}
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'active_support/json'
|
|||
require 'active_support/core_ext/object/to_json'
|
||||
require 'active_support/core_ext/hash/indifferent_access'
|
||||
|
||||
class OrderedHashTest < Test::Unit::TestCase
|
||||
class OrderedHashTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@keys = %w( blue green red pink orange )
|
||||
@values = %w( 000099 009900 aa0000 cc0066 cc6633 )
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'abstract_unit'
|
||||
|
||||
class OrderedOptionsTest < Test::Unit::TestCase
|
||||
class OrderedOptionsTest < ActiveSupport::TestCase
|
||||
def test_usage
|
||||
a = ActiveSupport::OrderedOptions.new
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ class CoolStargate < Stargate
|
|||
end
|
||||
|
||||
|
||||
class RescuableTest < Test::Unit::TestCase
|
||||
class RescuableTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@stargate = Stargate.new
|
||||
@cool_stargate = CoolStargate.new
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'abstract_unit'
|
||||
|
||||
class StringInquirerTest < Test::Unit::TestCase
|
||||
class StringInquirerTest < ActiveSupport::TestCase
|
||||
def test_match
|
||||
assert ActiveSupport::StringInquirer.new("production").production?
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/time'
|
||||
|
||||
class TimeZoneTest < Test::Unit::TestCase
|
||||
class TimeZoneTest < ActiveSupport::TestCase
|
||||
def test_utc_to_local
|
||||
zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
|
||||
assert_equal Time.utc(1999, 12, 31, 19), zone.utc_to_local(Time.utc(2000, 1)) # standard offset -0500
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'abstract_unit'
|
|||
require 'active_support/inflector/transliterate'
|
||||
require 'active_support/core_ext/object/inclusion'
|
||||
|
||||
class TransliterateTest < Test::Unit::TestCase
|
||||
class TransliterateTest < ActiveSupport::TestCase
|
||||
|
||||
def test_transliterate_should_not_change_ascii_chars
|
||||
(0..127).each do |byte|
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'test/unit'
|
|||
require 'rbconfig'
|
||||
require 'active_support/core_ext/kernel/reporting'
|
||||
|
||||
class TestIsolated < Test::Unit::TestCase
|
||||
class TestIsolated < ActiveSupport::TestCase
|
||||
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
||||
|
||||
Dir["#{File.dirname(__FILE__)}/**/*_test.rb"].each do |file|
|
||||
|
|
|
@ -3,7 +3,7 @@ if RUBY_PLATFORM =~ /java/
|
|||
require 'active_support/xml_mini'
|
||||
require 'active_support/core_ext/hash/conversions'
|
||||
|
||||
class JDOMEngineTest < Test::Unit::TestCase
|
||||
class JDOMEngineTest < ActiveSupport::TestCase
|
||||
include ActiveSupport
|
||||
|
||||
def setup
|
||||
|
|
|
@ -8,7 +8,7 @@ rescue LoadError
|
|||
# Skip libxml tests
|
||||
else
|
||||
|
||||
class LibxmlEngineTest < Test::Unit::TestCase
|
||||
class LibxmlEngineTest < ActiveSupport::TestCase
|
||||
include ActiveSupport
|
||||
|
||||
def setup
|
||||
|
|
|
@ -8,7 +8,7 @@ rescue LoadError
|
|||
# Skip libxml tests
|
||||
else
|
||||
|
||||
class LibXMLSAXEngineTest < Test::Unit::TestCase
|
||||
class LibXMLSAXEngineTest < ActiveSupport::TestCase
|
||||
include ActiveSupport
|
||||
|
||||
def setup
|
||||
|
|
|
@ -8,7 +8,7 @@ rescue LoadError
|
|||
# Skip nokogiri tests
|
||||
else
|
||||
|
||||
class NokogiriEngineTest < Test::Unit::TestCase
|
||||
class NokogiriEngineTest < ActiveSupport::TestCase
|
||||
include ActiveSupport
|
||||
|
||||
def setup
|
||||
|
|
|
@ -8,7 +8,7 @@ rescue LoadError
|
|||
# Skip nokogiri tests
|
||||
else
|
||||
|
||||
class NokogiriSAXEngineTest < Test::Unit::TestCase
|
||||
class NokogiriSAXEngineTest < ActiveSupport::TestCase
|
||||
include ActiveSupport
|
||||
|
||||
def setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/xml_mini'
|
||||
|
||||
class REXMLEngineTest < Test::Unit::TestCase
|
||||
class REXMLEngineTest < ActiveSupport::TestCase
|
||||
include ActiveSupport
|
||||
|
||||
def test_default_is_rexml
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'active_support/xml_mini'
|
|||
require 'active_support/builder'
|
||||
|
||||
module XmlMiniTest
|
||||
class RenameKeyTest < Test::Unit::TestCase
|
||||
class RenameKeyTest < ActiveSupport::TestCase
|
||||
def test_rename_key_dasherizes_by_default
|
||||
assert_equal "my-key", ActiveSupport::XmlMini.rename_key("my_key")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue