diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-07 17:23:25 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-08 00:35:36 -0700 |
commit | 6c970d79a064b953d3d9555a362a1ad1e0058d1c (patch) | |
tree | d46dd2b359d48d0a7713774173a1aacb12b9aafd /activesupport/test | |
parent | 06b6f435cb7ed4b171eb600d3a9286829b8b2482 (diff) | |
download | rails-6c970d79a064b953d3d9555a362a1ad1e0058d1c.tar.gz rails-6c970d79a064b953d3d9555a362a1ad1e0058d1c.tar.bz2 rails-6c970d79a064b953d3d9555a362a1ad1e0058d1c.zip |
Performance: faster Object.subclasses_of
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/class_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/test/core_ext/class_test.rb b/activesupport/test/core_ext/class_test.rb index 0346fad190..9c6071d478 100644 --- a/activesupport/test/core_ext/class_test.rb +++ b/activesupport/test/core_ext/class_test.rb @@ -38,9 +38,9 @@ class ClassTest < Test::Unit::TestCase @parent = eval("class D; end; D") @sub = eval("class E < D; end; E") @subofsub = eval("class F < E; end; F") - assert @parent.subclasses.all? { |i| [@sub.to_s, @subofsub.to_s].include?(i) } assert_equal 2, @parent.subclasses.size assert_equal [@subofsub.to_s], @sub.subclasses assert_equal [], @subofsub.subclasses + assert_equal [@sub.to_s, @subofsub.to_s].sort, @parent.subclasses.sort end end |