RSpec::Matchers.define :have_stdout do |expected|
  match do |result|
    if expected.is_a?(Regexp)
      expected.match(result.stdout)
    else