mongo_mapper_acts_as_tree 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
data/test/acts_as_tree_test.rb
CHANGED
@@ -104,6 +104,15 @@ class TreeTest < ActiveSupport::TestCase
|
|
104
104
|
assert_equal [@root1, @root2, @root3], TreeMixin.roots
|
105
105
|
end
|
106
106
|
|
107
|
+
def test_depth
|
108
|
+
assert_equal 0, @root1.depth
|
109
|
+
assert_equal 0, @root2.depth
|
110
|
+
assert_equal 0, @root3.depth
|
111
|
+
assert_equal 1, @root_child1.depth
|
112
|
+
assert_equal 1, @root_child2.depth
|
113
|
+
assert_equal 2, @child1_child.depth
|
114
|
+
end
|
115
|
+
|
107
116
|
def test_siblings
|
108
117
|
assert_equal [@root2, @root3], @root1.siblings
|
109
118
|
assert_equal [@root_child2], @root_child1.siblings
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_mapper_acts_as_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Tomas Celizna
|