Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-31 Thread Ashley Moran
On 31 Jul 2010, at 2:08 AM, nruth wrote: > Re: error / warning message, at the same scope (i.e. an accident, as > in the op) then yes that could be quite useful for spotting mistakes. > I'm not so sure about in different blocks though, it's probably > intentional there (different context). I for

Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-31 Thread Ashley Moran
On 31 Jul 2010, at 2:08 AM, nruth wrote: > If I want to set up a context to run some examples in (models created > with machinist, associations, etc) then the before block makes it > clear that that's the state the examples are running against, and the > @vars give me a (quick and dirty?) hook to

Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-30 Thread nruth
Hi Ash I've found let and before useful in different situations. I like let as a 'new feature' but am not sure it replaces, or is necessarily superior to, @vars in all cases for specs. If I want to set up a context to run some examples in (models created with machinist, associations, etc) then th

Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-30 Thread Ashley Moran
On 30 Jul 2010, at 10:00 PM, nruth wrote: > http://gist.github.com/501296 > > I don't think anything needs to change, though a wrapper function > (each + an inner describe) might help flag it as a possible pitfall. Hi Nick I think the "before + ivar" pattern (below) is on its way out. At leas

Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-30 Thread nruth
Hi David I think this was a case of idiot-end-user (or developer) on my part, sorry about that. I've produced a simple example here (and figured out what I was doing wrong). http://gist.github.com/501296 I don't think anything needs to change, though a wrapper function (each + an inner describe

Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-28 Thread David Chelimsky
On Jul 28, 2010, at 5:42 PM, nruth wrote: > Please correct me if this is fixed in Rspec 2, but in Rspec 1 I have > hit upon the following problem (at least thrice, this time it costing > me several hours), code is the best example: > > I have a practice examination system where each record is one

[rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-28 Thread nruth
Please correct me if this is fixed in Rspec 2, but in Rspec 1 I have hit upon the following problem (at least thrice, this time it costing me several hours), code is the best example: I have a practice examination system where each record is one of several "subtests" (think tagging rather than sub