1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/spec/spec_helper.rb
Kyrylo Silin 9732805a74 Fix failing build on 2.4 & 2.5
Example failure: https://github.com/pry/pry/runs/3010680604

```
ArgumentError: wrong number of arguments (given 4, expected 1)
    /home/runner/work/pry/pry/vendor/bundle/ruby/2.4.0/gems/psych-4.0.1/lib/psych.rb:323:in `safe_load'
```

I am not sure what exactly causes the failure but deleting simplecov dependency
fixes (I guess?) this problem.
2021-07-09 23:10:43 +03:00

49 lines
1.1 KiB
Ruby

# frozen_string_literal: true
require 'pry'
require 'rspec'
require 'pry/testable'
require 'English'
require 'stringio'
require 'ostruct'
Dir['./spec/support/**/*.rb'].map do |file|
require file
end
class Module
# False positive: https://github.com/rubocop-hq/rubocop/issues/5953
# rubocop:disable Style/AccessModifierDeclarations
public :remove_const
public :remove_method
# rubocop:enable Style/AccessModifierDeclarations
end
Pad = OpenStruct.new
# to help with tracking down bugs that cause an infinite loop in the test suite
if ENV["SET_TRACE_FUNC"]
set_trace_func(
proc { |event, file, line, id, _binding, classname|
STDERR.printf("%8s %s:%-2d %10s %8s\n", event, file, line, id, classname)
}
)
end
RSpec.configure do |config|
config.order = 'random'
config.before(:each) do
Pry::Testable.set_testenv_variables
end
config.after(:each) do
Pry::Testable.unset_testenv_variables
Pry.reset_defaults
end
config.include Pry::Testable::Mockable
config.include Pry::Testable::Utility
include Pry::Testable::Evalable
include Pry::Testable::Variables
end