Skip to content

Commit

Permalink
Update test_driven_development.md
Browse files Browse the repository at this point in the history
  • Loading branch information
memcmahon authored Oct 11, 2024
1 parent 8b8ce08 commit aceaf88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module1/lessons/test_driven_development.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ end
```

<section class="call-to-action">
### What might be the pitfalls in a test like this? How could we improve the test (and thus the behavior of our calculator?)
### What might be the pitfalls in a test like this? How could we improve the test (and thus the behavior of our Round?)

- We only have one card in our `cards` array, so even if the logic of this method didn't work, we wouldn't know because we don't have enough data in our setup to accurately test the logic. *The Fix:* adding more card objects to our `cards` array.
- The test is testing for `deck.cards.first`, but this is the same logic in the method, which can result in a false positive. Instead, we can test this more explictly and write `expect(round.current_card.name).to eq "2 of Hearts"` (this assumes a method in the Card class called #name that would string together the value and suit).
Expand Down

0 comments on commit aceaf88

Please sign in to comment.