mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
3e00e1a297
commit
1472bf273d
1 changed files with 16 additions and 19 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue