Sha256: 907d1ab50d7a5306af92af34db7d91538b1ed3609317220e745987b75fbdb069

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 Bytes

Contents

# encoding: utf-8

if ENV['COVERAGE'] == 'true'
  require 'simplecov'
  require 'coveralls'

  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
    SimpleCov::Formatter::HTMLFormatter,
    Coveralls::SimpleCov::Formatter
  ]

  SimpleCov.start do
    command_name 'spec:unit'

    add_filter 'config'
    add_filter 'spec'
  end
end

require 'httpkit'
require 'weakref'

require 'awesome_print'

require 'devtools/spec_helper'
require 'rspec/its'

RSpec.configure do |config|
  config.include(SpecHelper)

  config.around do |example|
    if example.metadata[:reactor]
      EM.run do
        EM.add_timer(0.25) { raise 'Example timed out' }

        Fiber.new do
          example.call
          EM.stop
          EM.next_tick {}
        end.resume
      end
    else
      Timeout.timeout(0.25) { example.call }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
httpkit-0.6.0 spec/spec_helper.rb
httpkit-0.6.0.pre.5 spec/spec_helper.rb