I was doing the famous Bob exercise in Swift.
It appears that there’s an issue on the tests.
Here is the actual test
func testForcefulQuestions() {
let input = "WHAT THE HELL WERE YOU THINKING?"
let expected = "Whoa, chill out!"
let result = Bob.hey(input)
XCTAssertEqual(expected, result)
}
Since asking a question and yelling are two values we can get from the input.
And not mutually exclusive, because we can shout a question after all.
The instructions are clear about Bob’s response.
He answers 'Calm down, I know what I'm doing!' if you yell a question at him.
So the tests should be updated to this:
func testForcefulQuestions() {
let input = "WHAT THE HELL WERE YOU THINKING?"
let expected = "Calm down, I know what I'm doing!"
let result = Bob.hey(input)
XCTAssertEqual(expected, result)
}
I’ve made a PR before seeing that the public PRs are closed for now.
I have the same issue with Objective-C tests… on the definition of the problem on the web there are 5 types of answers, but on the tests there ought be at least one with <<“Calm down, I know what I’m doing!” This is what he says if you yell a question at him.>>