[rspec-users] describe scope

David Chelimsky dchelimsky at gmail.com
Wed Nov 21 09:18:26 EST 2007


On Nov 21, 2007 1:07 AM, Mark Van De Vyver <mvyver at gmail.com> wrote:
> Hi,
> Googling 'RSpec describe scope' didn't yield much, so apologies if
> this question has been dealt with.
>
> It seem well known that a ruby class is 'visible' between describes,
> and if this is a problem then you should use some counter as prefix or
> suffix:
> 'class Item_001; ... end'
>
> Is there any work underway, or sheduled release where classes will
> exist only in the scope they are defined?

This has never been brought up before. Feel free to submit a feature
request at http://rspec.lighthouseapp.com/.

> Writing spec's for Og is where this becomes an issue because Og will
> grab _all_ manageble objects it can 'see'... all sorts of PITA can
> arise.

I found this:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/6924

So you could, in theory, monkey patch ExampleGroupMethods (in trunk
2937 - these names are changing a bit, so keep an eye out) to remove
the defined constant

>
> Thanks for all the great work, T/BDD definitely is a brilliant way to
> work, and RSpec makes it painless, esp for us amatuers :)

That's what we want to hear! Thanks.

Cheers,
David

>
> Mark
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list