Re: [rspec-users] Standardize environment between specs containing class defs

2007-10-04 Thread Mark Van De Vyver
On 9/21/07, Dan North <[EMAIL PROTECTED]> wrote: > > Although it would be nice (and not too difficult) to have the example > runner intercept any class creation (and perhaps other global/constant > definitions) and undef them after each example. > > It certainly seems reasonable to have any defin

Re: [rspec-users] Standardize environment between specs containing class defs

2007-09-21 Thread Dan North
Although it would be nice (and not too difficult) to have the example runner intercept any class creation (and perhaps other global/constant definitions) and undef them after each example. It certainly seems reasonable to have any defined classes go away after an example. aslak hellesoy wrot

Re: [rspec-users] Standardize environment between specs containing class defs

2007-09-20 Thread aslak hellesoy
You can have a global after block in your spec_helper.rb that undefines all such constants. Then you just have to remember to add these constants to some global array whenever you define them. a On 9/21/07, Matt Margolis <[EMAIL PROTECTED]> wrote: > I have some specs that involve the use of eval

[rspec-users] Standardize environment between specs containing class defs

2007-09-20 Thread Matt Margolis
I have some specs that involve the use of eval and class definitions to test code generation. I want to always start with a clean slate so none of my tests fail or succeed incorrectly due to artifacts left over from previous specs. Example of my situation Spec 1 defines class Fish c