Rspec be true weirdness #187

merged 2 commits into from Dec 3, 2012


None yet
2 participants

x3ro commented Dec 1, 2012

Splitting up #184 into smaller chunks.

RSpec's be_true seems to consider everything that is not nil to be true (or so they say), which is why one might want to use eq(true) instead (?). Mentioned RSpec behavior caused it not to fail even when remove_collaborator returned the request object instead of a boolean (which is stated as the return type in the method comment).

I've since verified that RSpec's be_true implementation is counterintuitive at best:

class BeTrue < BaseMatcher
    def match(_, actual)


By using !!actual, everything but nil and false will result in a positive result. Perhaps we should suggest a be_truthy method to them as well @joeyw 😄

@pengwynn pengwynn added a commit that referenced this pull request Dec 3, 2012

@pengwynn pengwynn Merge pull request #187 from x3ro/rspec-be-true-weirdness
Rspec be true weirdness

@pengwynn pengwynn merged commit 8c4b8a0 into octokit:master Dec 3, 2012

1 check passed

default The Travis build passed

pengwynn commented Dec 3, 2012

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