[rspec-users] should and != operator

Tero Tilus tero at tilus.net
Mon Oct 12 16:19:11 EDT 2009

2009-10-12 22:18, Tero Tilus:
> Expression x!=y is instead just syntactic sugar for !(x==y).

To illustrate how this affects #should, think of

  'some string'.should != 'some string'

Now Ruby internals kick in and desugar this (before anything is even
executed) to

  !('some string'.should == 'some string')

Which obviously does not fail.

Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/

More information about the rspec-users mailing list