How do I avoid the "Useless use of == in void context" in RSpec?

Viewed 8295

In RSpec, if I have warnings on and have

x.should == 42
another_line_of_code

then I get a warning about

warning: useless use of == in void context

Is there anything I can do other than

  1. Turn warnings off
  2. Change it to bitbucket = (x.should == 42)
3 Answers
Related