[rspec-users] [RSpec] [Rails] [BDD]
Ben Mabey
ben at benmabey.com
Sat Feb 28 21:04:26 EST 2009
> When you use instance_variable_set you are setting the variable
> inside the example group (the test) and not the actual controller
> it self.
>
>
> Ah ok - got it now. Thanks for clearing that up !
> Although it does leave me slightly confused as to what the object is
> that performs the test - i.e. who that instance variable belongs to
> (not that I need it now). I mean - unlike Test::Unit, there is no
> 'class AccountTest ' - I'll dig around and find out.
RSpec's DSL creates these classes and objects for you. You can think of
'describe' as an alias to 'class' in a way. (It is of course more
complicated than that.)
-Ben
More information about the rspec-users
mailing list