mardi 1 novembre 2016

Testing a whole script in Ruby

what is the best way of testing a whole script? Are there any frameworks that could help? I want to test if a script returns (prints) a correct result. So far what I have is another script that more or less does just:

# test.rb

expected = 'test'
output = `script.rb --many params`
if output != expected
  puts "Error"
end

In this example, the script I want to test is called script.rb. Cheers.

Aucun commentaire:

Enregistrer un commentaire