Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

  • Blog Navigation
Standup 6/9/2009 Spring Cleaning. rspec should == useless

Ask for help

Using Rspec 1.2.6 and an expression of some desired behavior such as this:

it "should score 0" do
  score = 0
  score.should == 0

Will sometimes result in a ruby warning:

warning: useless use of == in void context

There was a little confusion as to why this warning was sometimes appearing.
It turns out that the warning appears when the command ruby -w is used to run the spec rather than spec.
This seems to be the case when rake is run for a non rails project, say a plugin.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *

Share This