[rspec-devel] subject.should_be true

Dave Astels dastels at daveastels.com
Sun Oct 15 23:50:52 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 15-Oct-06, at 11:31 PM, David Chelimsky wrote:

> As things stand now, the following will all pass:
>
> true.should_be true
> "true".should_be true
> "false".should_be true
> 3.should_be true
> etc
>
> My feeling is that "should_be true" should only pass if it returns
> boolean true even though ruby says that non-nil/non-false is true.
>
> Anybody else?

I remember having this discussion a while ago.

I still think "should_be true" should reflect the Ruby concept of  
"true"... the principle of least surprise

Dave

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFMwGcauez/L4x7g4RAq9bAKDiWWJFsqcr8nUWf6n1X7xB8jsfsQCgphhX
Sg/wQf4y27KrubYsXi8N6Ec=
=says
-----END PGP SIGNATURE-----


More information about the rspec-devel mailing list