Sha256: 9a7e7e920d01007b70bf59583966d92f9300d17bce2c3a1f64987c2faeb3be35

Contents?: true

Size: 287 Bytes

Versions: 3

Compression:

Stored size: 287 Bytes

Contents

# encoding: utf-8

RSpec.configure do |config|

  # Captures stdout
  config.around :each, :capture do |example|
    begin
      $stdout = StringIO.new
      example.run
      result = $stdout.string
    ensure
      $stdout = STDOUT
    end
    result.to_s
  end

end # RSpec.configure

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hexx-rspec-0.2.2 config/initializers/capture.rb
hexx-rspec-0.2.1 config/initializers/capture.rb
hexx-rspec-0.2.0 config/initializers/capture.rb