/usr/lib/ruby/vendor_ruby/rspec/support/spec.rb is in ruby-rspec-support 3.5.0c3e0m0s0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | require 'rspec/support'
require 'rspec/support/spec/in_sub_process'
RSpec::Support.require_rspec_support "spec/deprecation_helpers"
RSpec::Support.require_rspec_support "spec/with_isolated_stderr"
RSpec::Support.require_rspec_support "spec/stderr_splitter"
RSpec::Support.require_rspec_support "spec/formatting_support"
RSpec::Support.require_rspec_support "spec/with_isolated_directory"
RSpec::Support.require_rspec_support "ruby_features"
warning_preventer = $stderr = RSpec::Support::StdErrSplitter.new($stderr)
RSpec.configure do |c|
c.include RSpecHelpers
c.include RSpec::Support::WithIsolatedStdErr
c.include RSpec::Support::FormattingSupport
c.include RSpec::Support::InSubProcess
unless defined?(Debugger) # debugger causes warnings when used
c.before do
warning_preventer.reset!
end
c.after do
warning_preventer.verify_no_warnings!
end
end
if c.files_to_run.one?
c.full_backtrace = true
c.default_formatter = 'doc'
end
c.filter_run_when_matching :focus
c.example_status_persistence_file_path = "./spec/examples.txt"
c.define_derived_metadata :failing_on_appveyor do |meta|
meta[:pending] ||= "This spec fails on AppVeyor and needs someone to fix it."
end if ENV['APPVEYOR']
end
module RSpec
module Support
module Spec
def self.setup_simplecov(&block)
# Simplecov emits some ruby warnings when loaded, so silence them.
old_verbose, $VERBOSE = $VERBOSE, false
return if ENV['NO_COVERAGE'] || RUBY_VERSION < '1.9.3'
return if RUBY_ENGINE != 'ruby' || RSpec::Support::OS.windows?
# Don't load it when we're running a single isolated
# test file rather than the whole suite.
return if RSpec.configuration.files_to_run.one?
require 'simplecov'
start_simplecov(&block)
rescue LoadError
warn "Simplecov could not be loaded"
ensure
$VERBOSE = old_verbose
end
def self.start_simplecov(&block)
SimpleCov.start do
add_filter "./bundle/"
add_filter "./tmp/"
add_filter do |source_file|
# Filter out `spec` directory except when it is under `lib`
# (as is the case in rspec-support)
source_file.filename.include?('/spec/') && !source_file.filename.include?('/lib/')
end
instance_eval(&block) if block
end
end
private_class_method :start_simplecov
end
end
end
|