On Mon, Aug 11, 2008 at 12:59 AM, Teedub <[EMAIL PROTECTED]> wrote:
> To my best understanding,
> [mock_page] would be an array containing mock_page. That almost makes
> sense, buy why wouldn't the variable mock_page simply be an array like
> @pages.

What you say is completely correct.  In the code you give, mock_page
is defined as singular.  It represents a single mock instance of a
Page model.  It isn't an array because it isn't defined that way.  But
you can (and do) *put* it in an array to represent a collection of
instances of the Page model.


> You wouldn't say [EMAIL PROTECTED]

No, you usually wouldn't (though you could).  But if you had a @page
variable that represented just one Page, it would be quite sensible
and common to say @pages == [EMAIL PROTECTED]

That's really all that mock_page is doing.



-- 
Have Fun,
Steve Eley
Deep Salt Team
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to