More helpful error messages for be_true and be_false #414

wants to merge 1 commit into

3 participants


These are a couple of helpful error messages when you try to use be_true and be_false. This would have been helpful for me when I started a new project using 3.0 and was surprised to find that be_true raised NoMethodError with the message undefined method `true?' for true:TrueClass, which lead me to believe something was broken in my environment. This will hopefully save some time for other people in the same situation.

RSpec member

@danielmurphy did you go through 2.99? It issues a warning informing you about this breaking change. There's also a Changelog entry.

I can see the use, but I think we decided against this when removing be_true and be_false. @myronmarston thoughts?


It was a brand new project so I figured I could just start with 3.0. I didn't realize what 2.99 was there for. I think that will be pretty common for people once 3.0 is out of beta.

But I could understand if this would be considered cruft. Maybe just leave it in until 3.1?

Also, see: #411 which also helps.

RSpec member

I'm not in favor of adding explicit NoMethodErrors for methods we've removed. It would add a ton of bloat to do this for all the methods we've removed, and it seems inconsistent to do it for some but not all.

Thanks for the PR, though.


Fair enough. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment