Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-31 Thread Ashley Moran
On 31 Jul 2010, at 7:06 PM, Myron Marston wrote: > Good point--I hadn't thought of that. The one issue I see with it is > that the author of the shared example group may not have knowledge of > which helper methods consumers will need to override. So he/she > either defines all helper methods t

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-31 Thread Myron Marston
> You can still get the same outcome, but you have to implement it in the group > like this: > unless defined?(:foo) > def foo; "foo"; end > end Good point--I hadn't thought of that. The one issue I see with it is that the author of the shared example group may not have knowledge of which help

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] Evaluating shared example customisation block before shared block

2010-07-31 Thread Ashley Moran
On 31 Jul 2010, at 1:10 AM, David Chelimsky wrote: > You can still get the same outcome, but you have to implement it in the group > like this: > > unless defined?(:foo) > def foo; "foo"; end > end Maybe a DSL method while I'm working on it? Maybe: default_helper(:foo) do "foo" end