Sha256: 5c47cae423e5be0e359b11c362e2d0f59de59fa7dd297ad86fa2bd682453444e

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

require 'pathname'
require 'bundler'
require 'timeout'

Bundler.with_clean_env do
  Dir.chdir('test_app') do
    YARD::CLI::Yardoc.run(*%w[--no-cache --no-output --no-stats --quiet --no-progress .])
  end
end

begin
  require 'mutest'

  module Mutest
    class Selector
      class Expression < self
        def call(_subject)
          integration.all_tests
        end
      end # Expression
    end # Selector
  end # Mutest
rescue LoadError
end

module YardcheckSpec
  ROOT = Pathname.new(__dir__).parent
  TEST_APP = ROOT.join('test_app')

  Yardcheck::Documentation.load_yard
  test_app_yardoc = TEST_APP.join('.yardoc')
  YARD::Registry.load!(test_app_yardoc.to_s)
  YARDOCS = YARD::Registry.all(:method)
end # YardcheckSpec

RSpec.configure do |config|
  # Define metadata for all tests which live under spec/integration
  config.define_derived_metadata(file_path: %r{\bspec/integration/}) do |metadata|
    # Set the type of these tests as 'integration'
    metadata[:type]   = :integration

    # Define metadata for mutant so it knows to never run these tests
    metadata[:mutest] = false
  end

  config.around(file_path: %r{\bspec/unit/}) do |example|
    Timeout.timeout(0.1, &example)
  end
end

$LOAD_PATH.unshift(YardcheckSpec::TEST_APP.join('lib').to_s)

require 'test_app'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yardcheck-0.0.3 spec/spec_helper.rb
yardcheck-0.0.2 spec/spec_helper.rb