diminish7 / rave

A Google Wave robot client framework for Ruby
http://github.com/diminish7/rave
MIT License
62 stars 8 forks source link

A lot of warnings when running the tests #27

Closed diminish7 closed 14 years ago

diminish7 commented 14 years ago

I get a lot of "already initialized constant" warnings when running the tests. I think because the example bot tests reload the environment. But we should add a check to make sure a constant isn't already defined before defining it

bil-bas commented 14 years ago

It is fine in my version, but you are working a bit behind so that bug was still there.

bil-bas commented 14 years ago

Actually, this is more correct (standard in any Ruby I've ever seen):

$:.unshift File.dirname(File.dirname(__FILE__))

require 'robot'

rather than:

require File.join(File.dirname(__FILE__), '..', 'robot')

The reason being that you should only require files by name, not path (the former code adds the path into the search). This avoids the possibility of re-requiring the same file.

And that was not the cause of this bug. The actual cause was trying to run the example spec files from the standard 'rake spec', rather than just in rake spooner-test:spec (or directly in the example directories). I took this out of the rakefile and it was fine again for me.

bil-bas commented 14 years ago

fixed errors anyway.