diff --git a/exercises/bob/Cargo.toml b/exercises/bob/Cargo.toml index b8180e46e..7f9904f72 100644 --- a/exercises/bob/Cargo.toml +++ b/exercises/bob/Cargo.toml @@ -1,3 +1,3 @@ [package] name = "bob" -version = "1.0.0" +version = "1.1.0" diff --git a/exercises/bob/README.md b/exercises/bob/README.md index 44fc4b047..a9caf5cfe 100644 --- a/exercises/bob/README.md +++ b/exercises/bob/README.md @@ -6,6 +6,8 @@ Bob answers 'Sure.' if you ask him a question. He answers 'Whoa, chill out!' if you yell at him. +He answers 'Calm down, I know what I'm doing!' if you yell a question at him. + He says 'Fine. Be that way!' if you address him without actually saying anything. diff --git a/exercises/bob/example.rs b/exercises/bob/example.rs index f753f0940..a6512f867 100644 --- a/exercises/bob/example.rs +++ b/exercises/bob/example.rs @@ -1,5 +1,6 @@ pub fn reply(message: &str) -> &str { if is_silence(message) { "Fine. Be that way!" } + else if is_yelling(message) && is_question(message) { "Calm down, I know what I'm doing!" } else if is_yelling(message) { "Whoa, chill out!" } else if is_question(message) { "Sure." } else { "Whatever." } diff --git a/exercises/bob/tests/bob.rs b/exercises/bob/tests/bob.rs index 5c48a4121..17df7ba00 100644 --- a/exercises/bob/tests/bob.rs +++ b/exercises/bob/tests/bob.rs @@ -52,7 +52,7 @@ fn test_using_acronyms_in_regular_speech() { #[test] #[ignore] fn test_forceful_question() { - assert_eq!("Whoa, chill out!", + assert_eq!("Calm down, I know what I'm doing!", bob::reply("WHAT THE HELL WERE YOU THINKING?")); }