diff options
| author | Szymon Szukalski <szymon@skas.io> | 2024-10-25 12:05:03 +1100 |
|---|---|---|
| committer | Szymon Szukalski <szymon@skas.io> | 2024-10-25 12:05:03 +1100 |
| commit | 5d5ca66762513dccfbc4e76782e81bc593258c68 (patch) | |
| tree | 4ad253977f23d0cb08b4d65e6895151aceb4871e /spec | |
| parent | 29fe91901a188af552a0bbaeb59eaf056fbe385d (diff) | |
Update README and fix incorrect outputs
- Don't output anything if the relationship is unsupported
- Fail if we're adding a child via the father to a family
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/family_tree_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/family_tree_spec.rb b/spec/family_tree_spec.rb index 90d08b3..4dbe83e 100644 --- a/spec/family_tree_spec.rb +++ b/spec/family_tree_spec.rb @@ -51,10 +51,10 @@ RSpec.describe FamilyTree do end context 'when the mother is not present' do - it 'fails to add a child and returns CHILD_ADDITION_FAILED' do + it 'fails to add a child and returns PERSON_NOT_FOUND' do FamilyTree.instance.families.clear # Clear existing families result = FamilyTree.instance.add_child('Unknown Mother', 'Charlie', Gender::MALE) - expect(result).to eq('CHILD_ADDITION_FAILED') + expect(result).to eq('PERSON_NOT_FOUND') end end end @@ -149,8 +149,8 @@ RSpec.describe FamilyTree do end context 'invalid relationships' do - it 'returns UNSUPPORTED_RELATIONSHIP for unsupported types' do - expect(FamilyTree.instance.get_relationship('Anna', 'uncle')).to eq('UNSUPPORTED_RELATIONSHIP') + it 'returns false for unsupported types' do + expect(FamilyTree.instance.get_relationship('Anna', 'uncle')).to eq(false) end end end |
