Problem in exiting from a file and continue with next file

K

Karthi kn

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...
 
S

Siep Korteling

Karthi said:
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
 
F

framefritti

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/ProgrammingRuby/html/tut_exceptions.html)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top