Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Problem in exiting from a file and continue with next file

Reply
Thread Tools

Problem in exiting from a file and continue with next file

 
 
Karthi kn
Guest
Posts: n/a
 
      04-10-2008
Hi,

I am writing automated test scripts using ruby. I have written two
files.

test_one.rb
test_two.rb

I have written some methods both the files. When one of the methods of
test_one.rb is running, If a condition fails, the control should exit
from test_one.rb and should continue with test_two.rb.

I tried with "exit" method. But it exits from the whole(i.e -
test_two.rb is not executed). I want to exit from the test_one.rb and
continue with test_two.rb.

Any of your suggestion is appreciated.

Thanks in advance...
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Siep Korteling
Guest
Posts: n/a
 
      04-10-2008
Karthi kn wrote:
> Hi,
>
> I am writing automated test scripts using ruby. I have written two
> files.
>
> test_one.rb
> test_two.rb
>
> I have written some methods both the files. When one of the methods of
> test_one.rb is running, If a condition fails, the control should exit
> from test_one.rb and should continue with test_two.rb.
>
> I tried with "exit" method. But it exits from the whole(i.e -
> test_two.rb is not executed). I want to exit from the test_one.rb and
> continue with test_two.rb.
>
> Any of your suggestion is appreciated.
>
> Thanks in advance...


If you are on windows:

system 'system start test_two.rb'
exit

regards,

Siep



--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
framefritti@gmail.com
Guest
Posts: n/a
 
      04-10-2008


Karthi kn ha scritto:

> Hi,
>
> I am writing automated test scripts using ruby. I have written two
> files.
>
> test_one.rb
> test_two.rb
>
> I have written some methods both the files. When one of the methods of
> test_one.rb is running, If a condition fails, the control should exit
> from test_one.rb and should continue with test_two.rb.
>
> I tried with "exit" method. But it exits from the whole(i.e -
> test_two.rb is not executed). I want to exit from the test_one.rb and
> continue with test_two.rb.
>
> Any of your suggestion is appreciated.
>
> Thanks in advance...



I'm in a rush, so I am not able to check my suggestion. Using "try/
catch"?
(see at the end of
http://www.ruby-doc.org/docs/Program...xceptions.html)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exiting given via next skendric@fhcrc.org Perl Misc 14 04-24-2009 04:35 PM
Reading of file by next of map file and by next of file descriptor. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki C++ 1 07-10-2007 02:46 AM
rescue and continue on next statement ? Zouplaz Ruby 5 07-04-2007 10:24 PM
CurrentElement->next = CurrentElement->next->next (UNDEFINED?) Deniz Bahar C Programming 2 03-09-2005 12:45 AM
How to make the program connect to next IP address without exiting program, if the current connection fail?? Abby C Programming 1 08-29-2003 03:08 AM



Advertisments