Sha256: 7a137d13fa98d8c3df773693b0ebda39dba46b2b416dc5561c4d8d7f4b5212c4

Contents?: true

Size: 304 Bytes

Versions: 5

Compression:

Stored size: 304 Bytes

Contents

# encoding: utf-8

RSpec.configure do |config|

  def capture_stdout
    $stdout = StringIO.new
    yield if block_given?

    $stdout.string
  rescue
    ""
  ensure
    $stdout = STDOUT
  end

  config.around :each, :capture do |example|
    capture_stdout { example.run }
  end

end # RSpec.configure

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hexx-rspec-0.4.2 config/initializers/capture.rb
hexx-rspec-0.4.1 config/initializers/capture.rb
hexx-rspec-0.4.0 config/initializers/capture.rb
hexx-rspec-0.3.1 config/initializers/capture.rb
hexx-rspec-0.3.0 config/initializers/capture.rb