Sha256: b6a07d3d7836ce4543be63f237de3f3a43cb4e98b818b99d2a2cfbbd3a123ab3
Contents?: true
Size: 870 Bytes
Versions: 7090
Compression:
Stored size: 870 Bytes
Contents
# frozen_string_literal: true # RuboCop can be run in contexts where unexpected other libraries are included, # which may interfere with its normal behavior. In order to test those # situations, it may be necessary to require another library for the duration # of one spec module HostEnvironmentSimulatorHelper def in_its_own_process_with(*files) if ::Process.respond_to?(:fork) pid = ::Process.fork do # Need to write coverage result under different name if defined?(SimpleCov) SimpleCov.command_name "rspec-fork-#{Process.pid}" SimpleCov.pid = Process.pid end files.each { |file| require file } yield end ::Process.wait(pid) # assert that the block did not fail expect($CHILD_STATUS).to be_success else warn 'Process.fork is not available.' end end end
Version data entries
7,090 entries across 7,053 versions & 48 rubygems