Browse files

cleaning up constantize tests

  • Loading branch information...
1 parent 26702a6 commit 4a7679ebcad97484d3c43a3f787b18562a61613e @tenderlove tenderlove committed Nov 5, 2012
Showing with 44 additions and 44 deletions.
  1. +44 −44 activesupport/test/constantize_test_cases.rb
View
88 activesupport/test/constantize_test_cases.rb
@@ -24,52 +24,52 @@ class Dice
module ConstantizeTestCases
def run_constantize_tests_on
- assert_nothing_raised { assert_equal Ace::Base::Case, yield("Ace::Base::Case") }
- assert_nothing_raised { assert_equal Ace::Base::Case, yield("::Ace::Base::Case") }
- assert_nothing_raised { assert_equal Ace::Base::Case::Dice, yield("Ace::Base::Case::Dice") }
- assert_nothing_raised { assert_equal Ace::Base::Fase::Dice, yield("Ace::Base::Fase::Dice") }
- assert_nothing_raised { assert_equal Ace::Gas::Case, yield("Ace::Gas::Case") }
- assert_nothing_raised { assert_equal Ace::Gas::Case::Dice, yield("Ace::Gas::Case::Dice") }
- assert_nothing_raised { assert_equal Case::Dice, yield("Case::Dice") }
- assert_nothing_raised { assert_equal Case::Dice, yield("Object::Case::Dice") }
- assert_nothing_raised { assert_equal ConstantizeTestCases, yield("ConstantizeTestCases") }
- assert_nothing_raised { assert_equal ConstantizeTestCases, yield("::ConstantizeTestCases") }
- assert_nothing_raised { assert_equal Object, yield("") }
- assert_nothing_raised { assert_equal Object, yield("::") }
- assert_raise(NameError) { yield("UnknownClass") }
- assert_raise(NameError) { yield("UnknownClass::Ace") }
- assert_raise(NameError) { yield("UnknownClass::Ace::Base") }
- assert_raise(NameError) { yield("An invalid string") }
- assert_raise(NameError) { yield("InvalidClass\n") }
- assert_raise(NameError) { yield("Ace::ConstantizeTestCases") }
- assert_raise(NameError) { yield("Ace::Base::ConstantizeTestCases") }
- assert_raise(NameError) { yield("Ace::Gas::Base") }
- assert_raise(NameError) { yield("Ace::Gas::ConstantizeTestCases") }
+ assert_equal Ace::Base::Case, yield("Ace::Base::Case")
+ assert_equal Ace::Base::Case, yield("::Ace::Base::Case")
+ assert_equal Ace::Base::Case::Dice, yield("Ace::Base::Case::Dice")
+ assert_equal Ace::Base::Fase::Dice, yield("Ace::Base::Fase::Dice")
+ assert_equal Ace::Gas::Case, yield("Ace::Gas::Case")
+ assert_equal Ace::Gas::Case::Dice, yield("Ace::Gas::Case::Dice")
+ assert_equal Case::Dice, yield("Case::Dice")
+ assert_equal Case::Dice, yield("Object::Case::Dice")
+ assert_equal ConstantizeTestCases, yield("ConstantizeTestCases")
+ assert_equal ConstantizeTestCases, yield("::ConstantizeTestCases")
+ assert_equal Object, yield("")
+ assert_equal Object, yield("::")
+ assert_raises(NameError) { yield("UnknownClass") }
+ assert_raises(NameError) { yield("UnknownClass::Ace") }
+ assert_raises(NameError) { yield("UnknownClass::Ace::Base") }
+ assert_raises(NameError) { yield("An invalid string") }
+ assert_raises(NameError) { yield("InvalidClass\n") }
+ assert_raises(NameError) { yield("Ace::ConstantizeTestCases") }
+ assert_raises(NameError) { yield("Ace::Base::ConstantizeTestCases") }
+ assert_raises(NameError) { yield("Ace::Gas::Base") }
+ assert_raises(NameError) { yield("Ace::Gas::ConstantizeTestCases") }
end
def run_safe_constantize_tests_on
- assert_nothing_raised { assert_equal Ace::Base::Case, yield("Ace::Base::Case") }
- assert_nothing_raised { assert_equal Ace::Base::Case, yield("::Ace::Base::Case") }
- assert_nothing_raised { assert_equal Ace::Base::Case::Dice, yield("Ace::Base::Case::Dice") }
- assert_nothing_raised { assert_equal Ace::Base::Fase::Dice, yield("Ace::Base::Fase::Dice") }
- assert_nothing_raised { assert_equal Ace::Gas::Case, yield("Ace::Gas::Case") }
- assert_nothing_raised { assert_equal Ace::Gas::Case::Dice, yield("Ace::Gas::Case::Dice") }
- assert_nothing_raised { assert_equal Case::Dice, yield("Case::Dice") }
- assert_nothing_raised { assert_equal Case::Dice, yield("Object::Case::Dice") }
- assert_nothing_raised { assert_equal ConstantizeTestCases, yield("ConstantizeTestCases") }
- assert_nothing_raised { assert_equal ConstantizeTestCases, yield("::ConstantizeTestCases") }
- assert_nothing_raised { assert_equal Object, yield("") }
- assert_nothing_raised { assert_equal Object, yield("::") }
- assert_nothing_raised { assert_equal nil, yield("UnknownClass") }
- assert_nothing_raised { assert_equal nil, yield("UnknownClass::Ace") }
- assert_nothing_raised { assert_equal nil, yield("UnknownClass::Ace::Base") }
- assert_nothing_raised { assert_equal nil, yield("An invalid string") }
- assert_nothing_raised { assert_equal nil, yield("InvalidClass\n") }
- assert_nothing_raised { assert_equal nil, yield("blargle") }
- assert_nothing_raised { assert_equal nil, yield("Ace::ConstantizeTestCases") }
- assert_nothing_raised { assert_equal nil, yield("Ace::Base::ConstantizeTestCases") }
- assert_nothing_raised { assert_equal nil, yield("Ace::Gas::Base") }
- assert_nothing_raised { assert_equal nil, yield("Ace::Gas::ConstantizeTestCases") }
- assert_nothing_raised { assert_equal nil, yield("#<Class:0x7b8b718b>::Nested_1") }
+ assert_equal Ace::Base::Case, yield("Ace::Base::Case")
+ assert_equal Ace::Base::Case, yield("::Ace::Base::Case")
+ assert_equal Ace::Base::Case::Dice, yield("Ace::Base::Case::Dice")
+ assert_equal Ace::Base::Fase::Dice, yield("Ace::Base::Fase::Dice")
+ assert_equal Ace::Gas::Case, yield("Ace::Gas::Case")
+ assert_equal Ace::Gas::Case::Dice, yield("Ace::Gas::Case::Dice")
+ assert_equal Case::Dice, yield("Case::Dice")
+ assert_equal Case::Dice, yield("Object::Case::Dice")
+ assert_equal ConstantizeTestCases, yield("ConstantizeTestCases")
+ assert_equal ConstantizeTestCases, yield("::ConstantizeTestCases")
+ assert_equal Object, yield("")
+ assert_equal Object, yield("::")
+ assert_nil yield("UnknownClass")
+ assert_nil yield("UnknownClass::Ace")
+ assert_nil yield("UnknownClass::Ace::Base")
+ assert_nil yield("An invalid string")
+ assert_nil yield("InvalidClass\n")
+ assert_nil yield("blargle")
+ assert_nil yield("Ace::ConstantizeTestCases")
+ assert_nil yield("Ace::Base::ConstantizeTestCases")
+ assert_nil yield("Ace::Gas::Base")
+ assert_nil yield("Ace::Gas::ConstantizeTestCases")
+ assert_nil yield("#<Class:0x7b8b718b>::Nested_1")
end
end

0 comments on commit 4a7679e

Please sign in to comment.