[rspec-users] should and != operator

Ashley Moran ashley.moran at patchspace.co.uk
Wed Oct 14 14:12:00 EDT 2009

On 14 Oct 2009, at 17:01, Stephen Eley wrote:

> Did your brain try to warn you?  You're part of the system, you  
> know.  >8->

Well I already know not to do `should !=`, so I don't do it.  But I  
was suggesting that RSpec could make an AST pass over the specs to  
pick up this, which is undetectable otherwise - at least under Ruby  
<1.9, apparently.  (It would be something like mini RSpecLint, I  
guess.)  != caught me out quite a few times when I was first learning  
RSpec.  I misinterpreted your comment to mean that something like this  
was already in RSpec.

> If you don't care whether the code is useful, I'm baffled as to why
> you might care whether the tests are useful.

Lol, I was joking!  The implication was I always write specs* because  
I always care if the code is useful.


* Actually, that's a lie.  I have support code in my Cucumber features  
that has no specs, and yes, we've found bugs in them.  But all my non- 
false-positive features prove that they work =)  So maybe I should  
say, "I always write specs except when I don't, and I always regret it  
when I don't".


More information about the rspec-users mailing list