Problem in exiting from a file and continue with next file

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…

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

Karthi kn ha scritto:

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)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs