You could also use variable called __FILE__

On Mar 25, 9:31 am, "vladimir...@hotmail.com"
<vladimir...@hotmail.com> wrote:
> Thank you very much, Bill.
>
> The idea is to name the results file for each script in a test set by
> the name of the script.
> All scripts use Test::Unit class and have the same setup method.
> If I run system("ruby test1.rb"), in setup I read the name of the
> script and create a results file called test1.txt.
>
> Regards,
> Vladimir
>
> On Mar 24, 1:25 pm, Bill Agee <billa...@gmail.com> wrote:
>
> > $0 contains the filename being executed, so that should do what you want.
>
> > For more info on this kind of thing, this page is pretty useful:
>
> >http://www.zenspider.com/Languages/Ruby/QuickRef.html
>
> > The Ruby O'Reilly book is also great as a reference for this sort of stuff.
>
> > Thanks
> > Bill
>
> > On Tue, Mar 24, 2009 at 12:16 PM, vladimir...@hotmail.com <
>
> > vladimir...@hotmail.com> wrote:
>
> > > ARGV allows us to get script's input parameters.
> > > Is there a way to extract the script name from the following command:
>
> > > ruby script_name.rb param1 param2
>
> > > I need to get 'script_name'. I use it later to name the results file
> > > after the script name.- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to