[rspec-users] step definitons to check login

Nicolás Sanguinetti godfoca at gmail.com
Wed Dec 17 10:17:19 EST 2008

Module#public (a private method) works in one of two ways: 1) it
receives a list of symbols with method names, those methods are
decorated as public. 2) it receives no arguments, in which case all
methods defined from that point forward (until another visibility
declaration is encountered in the class definition or the class
closed) are public.

Same with Module#protected and Module#private.

So what he's doing is turning logged_in?, current_user and authorized
into public methods.

Of course, a 30 second trip in google land would have led you to the
ruby documentation, where you'd have found a good explanation with
examples. Or, running `ri public` would've steered you in the right


/me wishes people used ri more.

On Wed, Dec 17, 2008 at 12:45 PM, James Byrne <lists at ruby-forum.com> wrote:
> Andrew Premdas wrote:
>> Doing this for Restful-Authentication I add the following in
>> features/support/env.rb
>> # Make visible for testing
>> ApplicationController.send(:public, :logged_in?, :current_user,
>> :authorized?)
> Forgive my ignorance but would you do me the favour of explaining
> exactly what this does?  I can guess but I would rather have a clear
> understanding of how this construct works so that I can generalize its
> application.
> Regards,
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list