[rspec-users] Macros and accessing block-variables (rspec2)
ashley.moran at patchspace.co.uk
Fri Aug 6 05:27:34 EDT 2010
On Aug 06, 2010, at 1:24 am, Myron Marston wrote:
> It's the difference between an instance variable of a Class instance
> (since Classes are objects, too), and an instance variable of an
> instance of a class.
I talked a .Net dev friend of mine through instance ivar + class ivar + class variables last weekend. His response was something along the lines of "Woah!" :)
Gudleik - the simplest, readable change I can think of is to make the answer a constant. The answer is really a property of the spec, not of the examples, so it doesn't belong in the `before` block. But I suspect the example you've given is a simplified version of something more complex, so real-world solution may be different.
More information about the rspec-users