0

I have a bash script that has -i option to run things interactively. Basically, it will ask user to input something. Based on the answer, it will again ask user to input something else. And the script will does some validation when it receives user input. The existing integration test is written in java. And I wonder is it possible to test this -i option?

I dont have any clue how to write tests in this scenario.

Sören
  • 1,803
  • 2
  • 16
  • 23
cyyy
  • 1

1 Answers1

0

You can use the expect command. Or write a 'driver' for your shell scripts in a similar way if you prefer another programming language.

See

Queeg
  • 7,748
  • 1
  • 16
  • 42