sutty/test/test_helper.rb

16 lines
402 B
Ruby
Raw Normal View History

2018-01-02 17:19:25 +00:00
require File.expand_path('../../config/environment', __FILE__)
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
Open3::popen3('git reset --hard') do |_, _, _, thread|
# Wait for the process to finish
thread.value
end
end
end
2018-01-02 17:19:25 +00:00
end