Search code examples
iphoneiosrubyshellfrank

Run a shell script from ruby


I am doing iOS testing using Frank. It is a ruby gem that uses Cucumber as well. I have a "Given" step that checks whether the app is running or if it has crashed. If my step finds that it has crashed I would like to launch the app again. I launch the app using a shell script which is stored somewhere near the cucumber .feature files.

How can I call a script from that step definition?


Solution

  • You can do this a few different ways

    Kernel.system "command"
    %x[command]
    `command`