sutty/test/test_helper.rb

18 lines
428 B
Ruby
Raw Normal View History

2019-03-26 15:32:20 +00:00
# frozen_string_literal: true
require File.expand_path('../config/environment', __dir__)
2018-01-02 17:19:25 +00:00
require 'rails/test_help'
2018-04-27 18:48:26 +00:00
require 'open3'
2018-01-02 17:19:25 +00:00
class ActiveSupport::TestCase
2018-04-27 18:48:26 +00:00
# Resetear el repositorio a su estado original antes de leerlo
def reset_git_repo(path)
Dir.chdir(path) do
2019-03-26 15:32:20 +00:00
Open3.popen3('git reset --hard') do |_, _, _, thread|
2018-04-27 18:48:26 +00:00
# Wait for the process to finish
thread.value
end
end
end
2018-01-02 17:19:25 +00:00
end