Testing a whole script in Ruby
<p>What is the best way of testing a whole script? 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:</p>

<p><code># test.rb</code></p>

<pre><code>expected = 'test'
output = `script.rb --many params`
if output != expected
  puts "Error"
end
</code></pre>

<p>In this example, the script I want to test is called script.rb.
Cheers.</p>