aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/mixin_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 06:25:17 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 06:25:17 +0000
commit1472bf273d9f61208d3096fc42aa507be6184b45 (patch)
treec65b3e095e0410a9f5d9533780981651966c89f4 /activerecord/test/mixin_test.rb
parent3e00e1a297b70a6ae6e8ac3971ab2d49b6e01666 (diff)
downloadrails-1472bf273d9f61208d3096fc42aa507be6184b45.tar.gz
rails-1472bf273d9f61208d3096fc42aa507be6184b45.tar.bz2
rails-1472bf273d9f61208d3096fc42aa507be6184b45.zip
Fix tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/mixin_test.rb')
-rw-r--r--activerecord/test/mixin_test.rb35
1 files changed, 16 insertions, 19 deletions
diff --git a/activerecord/test/mixin_test.rb b/activerecord/test/mixin_test.rb
index 69789a0cec..4fcc6b6fba 100644
--- a/activerecord/test/mixin_test.rb
+++ b/activerecord/test/mixin_test.rb
@@ -249,9 +249,24 @@ class TreeTest < Test::Unit::TestCase
assert mixins(:tree_1).children.include?(mixins(:tree_4))
end
+ def test_ancestors
+ assert_equal [], mixins(:tree_1).ancestors
+ assert_equal [mixins(:tree_1)], mixins(:tree_2).ancestors
+ assert_equal [mixins(:tree_2), mixins(:tree_1)], mixins(:tree_3).ancestors
+ assert_equal [mixins(:tree_1)], mixins(:tree_4).ancestors
+ assert_equal [], mixins(:tree2_1).ancestors
+ assert_equal [], mixins(:tree3_1).ancestors
+ end
+
def test_root
assert_equal mixins(:tree_1), TreeMixin.root
- end
+ assert_equal mixins(:tree_1), mixins(:tree_1).root
+ assert_equal mixins(:tree_1), mixins(:tree_2).root
+ assert_equal mixins(:tree_1), mixins(:tree_3).root
+ assert_equal mixins(:tree_1), mixins(:tree_4).root
+ assert_equal mixins(:tree2_1), mixins(:tree2_1).root
+ assert_equal mixins(:tree3_1), mixins(:tree3_1).root
+ end
def test_roots
assert_equal [mixins(:tree_1), mixins(:tree2_1), mixins(:tree3_1)], TreeMixin.roots
@@ -316,22 +331,4 @@ class TouchTest < Test::Unit::TestCase
Mixin.record_timestamps = true
end
- def test_ancestors
- assert_equal [], mixins(:tree_1).ancestors
- assert_equal [mixins(:tree_1)], mixins(:tree_2).ancestors
- assert_equal [mixins(:tree_2), mixins(:tree_1)], mixins(:tree_3).ancestors
- assert_equal [mixins(:tree_1)], mixins(:tree_4).ancestors
- assert_equal [], mixins(:tree2_1).ancestors
- assert_equal [], mixins(:tree3_1).ancestors
- end
-
- def test_root
- assert_equal mixins(:tree_1), TreeMixin.root
- assert_equal mixins(:tree_1), mixins(:tree_1).root
- assert_equal mixins(:tree_1), mixins(:tree_2).root
- assert_equal mixins(:tree_1), mixins(:tree_3).root
- assert_equal mixins(:tree_1), mixins(:tree_4).root
- assert_equal mixins(:tree2_1), mixins(:tree2_1).root
- assert_equal mixins(:tree3_1), mixins(:tree3_1).root
- end
end