Re: [rspec-users] Macros and accessing block-variables (rspec2)

2010-08-06 Thread Ashley Moran
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

[rspec-users] Macros and accessing block-variables (rspec2)

2010-08-05 Thread Gudleik Rasch
Hi, I'm trying to create an rspec macro (for rspec2) but it cannot access variables defined in a before-block. Am I missing something or is it supposed to be like that? Here's a full example: http://gist.github.com/509802 -- gudleik ___ rspec-users

Re: [rspec-users] Macros and accessing block-variables (rspec2)

2010-08-05 Thread Myron Marston
The before block and the macro declaration get run in different contexts. In the before block, self is an instance of the example group. Your macro declaration runs with self set to the example group itself. It's the difference between an instance variable of a Class instance (since Classes are