title: suppresing output to console with ruby
body: <p>I am writing some unit tests like the following:</p>
  
  <pre><code>def executing_a_signal
    a_method(a_signal.new, a_model, a_helper);
    assert_equal(new_state, a_model.state)
  end
  </code></pre>
  
  <p>The tests work fine, but the method which runs just before the assertion to execute the logic prints various messages to the console, mainly via <code>puts</code>.</p>
  
  <p>Is there a quick, perhaps built-in, way to suppress that output to the console? I am only interested in the final effect of the method on the model object, and for the sake of keeping the console clean basically, I was hoping to find a way to simply prevent all output to the console without re-writing or commenting out those <code>puts</code> statements just for my tests.</p>
  
  <p>It is definitely not a critical issue, but would very much like to hear any thoughts or ideas (or workaround) on it.</p>