Finished challenge - David and Luke#98
Finished challenge - David and Luke#98levine1726 wants to merge 2 commits intopaircolumbus:masterfrom
Conversation
| @@ -19,8 +19,21 @@ def run! | |||
|
|
|||
|
|
|||
| def speak(input) | |||
There was a problem hiding this comment.
Nice job solving it! Does this method look like it's got a lot of decisions being made? Think about how you might be able to refactor this to make the code paths a little easier to follow.
There was a problem hiding this comment.
Refactored the code to reduce if statements and minimize code block length
spec/deaf_grandma_spec.rb
Outdated
|
|
||
| it "EXTRA CREDIT: How would you test yelling BYE?" do | ||
| #implement your test here | ||
| expect(script.speak("BYE")).to eq "NOT SINCE 1964!" |
There was a problem hiding this comment.
We only want Grandma to respond if you have yelled 3 times at her. Think about how you could write a test to make sure the first two times you say bye, she doesn't respond.
There was a problem hiding this comment.
Made fix to return empty string
| @bye_counter += 1 | ||
| "" | ||
| else | ||
| @bye_counter = 0 |
There was a problem hiding this comment.
You don't need to reset the bye counter here and see if you can get the program to exit after the 3rd bye.
No description provided.