5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 08:56:22 +00:00
panel/test/test_helper.rb
f 76fd32bd92
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix: no cargar seeds en los tests por ahora
2023-10-06 11:10:09 -03:00

23 lines
629 B
Ruby

# frozen_string_literal: true
require File.expand_path('../config/environment', __dir__)
require 'rails/test_help'
require 'open3'
# rubocop:disable Style/ClassAndModuleChildren
class ActiveSupport::TestCase
include FactoryBot::Syntax::Methods
# Resetear el repositorio a su estado original antes de leerlo
#
# TODO mover a Site.reset! cuando empecemos a trabajar con git
def reset_git_repo(path)
Dir.chdir(path) do
Open3.popen3('git reset --hard') do |_, _, _, thread|
# Wait for the process to finish
thread.value
end
end
end
end
# rubocop:enable Style/ClassAndModuleChildren