Sha256: 07c97439f7aff8dacb08742fe6120ae7c51799f0a3ca8ca3add16eefc75d0611

Contents?: true

Size: 1.27 KB

Versions: 2

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true
require 'bundler'
Bundler.setup(:default, :development)
require 'rspec/core'
require 'rspec/mocks'

Thread.report_on_exception = false

require 'simplecov'
unless SimpleCov.running
  SimpleCov.start do
    add_filter('spec')
  end
end

class ListIncompletelyCoveredFiles
  def format(result)
    incompletes = result.files.select { |f| f.covered_percent < 100 }

    unless incompletes.empty?
      puts
      puts "Files with incomplete test coverage:"
      incompletes.each do |f|
        printf "    %2.01f%%    %s\n", f.covered_percent, f.filename
      end
      puts; puts
    end
  end
end

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
  SimpleCov::Formatter::HTMLFormatter,
  ListIncompletelyCoveredFiles
])

require_relative "./example_group_methods"
require_relative "./example_methods"

RSpec.configure do |config|
  config.extend ExampleGroupMethods
  config.include ExampleMethods

  config.order = :random
  config.fail_fast = !!ENV["RSPEC_CONFIG_FAIL_FAST"]
  config.full_backtrace = !!ENV["RSPEC_CONFIG_FULL_BACKTRACE"]

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  config.after(:each) do
    Thread.current.name = nil
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
service_skeleton-2.2.0 ultravisor/spec/spec_helper.rb
service_skeleton-2.1.0 ultravisor/spec/spec_helper.rb