summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSzymon Szukalski <szymon@skas.io>2024-10-25 01:51:28 +1100
committerSzymon Szukalski <szymon@skas.io>2024-10-25 01:51:28 +1100
commitc8b917b1e0f217bf529918d540c49d07a69dba3e (patch)
tree07945a2b0d8dfcfc9845ee993703cdb9aa8599ee /lib
parent178a45d378c142dd074da5d1a4a7be6b0d26ffd8 (diff)
Write test cases for new relationships
Diffstat (limited to 'lib')
-rw-r--r--lib/family_tree.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/family_tree.rb b/lib/family_tree.rb
index 0c9ecef..0909ed1 100644
--- a/lib/family_tree.rb
+++ b/lib/family_tree.rb
@@ -83,7 +83,7 @@ class FamilyTree
case relationship.downcase
when 'child'
- children.map(&:name).join(' ')
+ children.empty? ? 'NONE' : children.map(&:name).join(' ')
when 'son'
sons = children.select { |child| child.gender == Gender::MALE }
sons.empty? ? 'NONE' : sons.map(&:name).join(' ')