Sha256: 2613dc0c905611a6c22c440278629e52ebdcdd32ecfc34aa98742d248623d913

Contents?: true

Size: 265 Bytes

Versions: 5

Compression:

Stored size: 265 Bytes

Contents

module StdoutHelpers
  def capture_stdout
    orig_stdout = $stdout
    $stdout = StringIO.new

    yield

    $stdout.string
  ensure
    $stdout = orig_stdout
  end

  alias silence_stdout capture_stdout
end

RSpec.configure do |c|
  c.include(StdoutHelpers)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
license_finder-2.0.3 spec/support/stdout_helpers.rb
license_finder-2.0.2 spec/support/stdout_helpers.rb
license_finder-2.0.1 spec/support/stdout_helpers.rb
license_finder-2.0.0 spec/support/stdout_helpers.rb
license_finder-2.0.0.rc2 spec/support/stdout_helpers.rb