module Maxitest::Helpers::InstanceMethods

def capture_stdout

stripped down version of capture_io
def capture_stdout
  _synchronize do
    begin
      captured_stdout = StringIO.new
      orig_stdout = $stdout
      $stdout = captured_stdout
      yield
      return captured_stdout.string
    ensure
      $stdout = orig_stdout
    end
  end
end