I'd prefer to test for equality since this way we show what output we do expect.
Your approach allow "boom" as output, which is not an expected output ;)
At the same time I agree that testing for exact number of spaces and \n\r is overkill here.
Perhaps we could either remove all white-spaces from the output and use eq, or use some regexp which explicitly shows what output is expected (e.g. something like ```/\s*boo\s*```.  
What do you think?