mirror of
https://github.com/funamitech/mastodon
synced 2024-11-27 22:38:42 +09:00
Remove Ruby GC config from spec helper (#25455)
This commit is contained in:
parent
e686a54064
commit
b276b3bb83
@ -1,7 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
GC.disable
|
|
||||||
|
|
||||||
if ENV['DISABLE_SIMPLECOV'] != 'true'
|
if ENV['DISABLE_SIMPLECOV'] != 'true'
|
||||||
require 'simplecov'
|
require 'simplecov'
|
||||||
SimpleCov.start 'rails' do
|
SimpleCov.start 'rails' do
|
||||||
@ -13,8 +11,6 @@ if ENV['DISABLE_SIMPLECOV'] != 'true'
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
gc_counter = -1
|
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
config.example_status_persistence_file_path = 'tmp/rspec/examples.txt'
|
config.example_status_persistence_file_path = 'tmp/rspec/examples.txt'
|
||||||
config.expect_with :rspec do |expectations|
|
config.expect_with :rspec do |expectations|
|
||||||
@ -37,21 +33,8 @@ RSpec.configure do |config|
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.after :suite do
|
config.after :suite do
|
||||||
gc_counter = 0
|
|
||||||
FileUtils.rm_rf(Dir[Rails.root.join('spec', 'test_files')])
|
FileUtils.rm_rf(Dir[Rails.root.join('spec', 'test_files')])
|
||||||
end
|
end
|
||||||
|
|
||||||
config.after :each do
|
|
||||||
gc_counter += 1
|
|
||||||
|
|
||||||
if gc_counter > 19
|
|
||||||
GC.enable
|
|
||||||
GC.start
|
|
||||||
GC.disable
|
|
||||||
|
|
||||||
gc_counter = 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def body_as_json
|
def body_as_json
|
||||||
|
Loading…
Reference in New Issue
Block a user