[Rspec-devel] warnings when running rake test

aslak hellesoy aslak.hellesoy at gmail.com
Sun Aug 27 06:13:54 EDT 2006


On 8/27/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 8/26/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> > On 8/27/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> > > The test task is currently set to show all the warnings. I'd like to
> > > either turn them off or modify code to get rid of them.
> > >
> >
> > I thought I had got rid of all the warnings now.
> >
> > > Preferences?
> > >
> >
> > Keep the warning flag on and keep our code clean.
>
> I agree in spirit, but what "clean" means is subjective. For example,
> one warning we get is in reporter.rb:
>
>         return @end_time - @start_time unless (@end_time.nil? or
> @start_time.nil?)
>
> This line of code seems perfectly clean, but a warning is generated
> stating that @end_time is not initialized. Cleaning this up would
> require the following in the initialize method:
>
>   @start_time = nil
>   @end_time = nil
>
> Perhaps that is more clear, but it is also more verbose.
>

I agree it's more verbose than my taste.
What -w warns about is Matz' subjective taste.

I don't care too much whether we follow my, your, matz' or anyone
else's taste in this matter. You decide ;-)

Aslak

> Another weird one is in /test/spec/test_to_spec/testfiles/test_unit_api_test.rb:
>
> warning: method redefined; discarding old setup
>
> Wassup w/ that?
>

def setup
end

def setup
end

-probably something we ought to look into

Aslak

>
>
> >
> > Aslak
> >
> > > David
> > > _______________________________________________
> > > Rspec-devel mailing list
> > > Rspec-devel at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/rspec-devel
> > >
> > _______________________________________________
> > Rspec-devel mailing list
> > Rspec-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-devel
> >
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the Rspec-devel mailing list