I am assuming that the get_method_name just gets the name of the
method that is currently running. In that case, since the logger
statement in the setup methods, it will get that name which is not
what you want. I don't know of any way not to include something in
each method. You can create an instance variable in each method and
then pass it to the 'teardown' method which runs after each method is
run (setup runs before each method is run). I am not sure this will
save you a lot of typing. You can also add to your get_method_name the
logger but you sill have to call that method from each method.
On Sep 10, 1:09 pm, Joel Saltzmanjoelh <[EMAIL PROTECTED]
s.net> wrote:
> def setup
> logger.info("\n\n STARTING #{get_method_name} \n\n")
> end
>
> gives me
>
> STARTING setup_without_fixtures
>
> in my log. If I put my logger in each method it prints fine.
>
> def test_account_create
> logger.info("\n\n STARTING #{get_method_name} \n\n")
> assert Account.create(:name => "Bob's Tofu House", :short_name =>
> "bths")
> end
>
> will print
>
> STARTING test_account_create
>
> any ideas why?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---