Problem in exiting from a file and continue with next file

Discussion in 'Ruby' started by Karthi kn, Apr 10, 2008.

  1. Karthi kn

    Karthi kn Guest

    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/.
     
    Karthi kn, Apr 10, 2008
    #1
    1. Advertising

  2. 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/.
     
    Siep Korteling, Apr 10, 2008
    #2
    1. Advertising

  3. Karthi kn

    Guest

    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)
     
    , Apr 10, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Abby
    Replies:
    1
    Views:
    495
    Jack Klein
    Aug 29, 2003
  2. Deniz Bahar
    Replies:
    2
    Views:
    480
    Andrey Tarasevich
    Mar 9, 2005
  3. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki

    Reading of file by next of map file and by next of file descriptor.

    =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki, Jul 10, 2007, in forum: C++
    Replies:
    1
    Views:
    796
    Alf P. Steinbach
    Jul 10, 2007
  4. Zouplaz
    Replies:
    5
    Views:
    521
    Juan Matias
    Jul 4, 2007
  5. Exiting given via next

    , Apr 22, 2009, in forum: Perl Misc
    Replies:
    14
    Views:
    225
Loading...

Share This Page