[rspec-users] Warnings

aslak hellesoy aslak.hellesoy at gmail.com
Tue Dec 16 18:32:36 EST 2008

On Tue, Dec 16, 2008 at 11:46 PM, Scott Taylor <scott at railsnewbie.com>wrote:

> On Dec 16, 2008, at 5:17 PM, Avdi Grimm wrote:
>  So I was running my specs with -w the other day, and noticed a lot of
>> warnings being produced.  Some of these appear to be coming from RSpec
>> internals, which is an issue in its own right but not the subject of
>> this email.  What I'm asking about right now is this.  Given an
>> example of the form:
>>   @foo.should == 42
>> Running the spec with ruby -w produces a warning to the effect that
>> I'm "making a comparison in a void context".  Now, this is a perfectly
>> reasonable warning anywhere but in an RSpec spec.  My question is: is
>> anyone running RSpec with -w turned on, and if so, how are you
>> avoiding warnings of this nature?
Ruby gives a warning because the result of the == isn't stored anywhere. If
you do

  x = @foo.should == 42

The waring is gone. There isn't much we can do about it - it's how Ruby
decides to warn.


> I haven't noticed any.
> Post a bug report on lighthouse, with full backtrace and error message,
> ruby (& rails version), rspec version, and OS.
> Scott
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081217/e721f7fe/attachment.html>

More information about the rspec-users mailing list