# encoding: utf-8 require_relative ::File.expand_path('../../../spec/support/git', __FILE__) module LocalPac class FileServeController class SpecHelperFileServer include LocalPac::SpecHelper::GitHelper def initialize LocalPac.ui_logger.level = ::Logger::UNKNOWN config = Class.new do include FeduxOrg::Stdlib::Filesystem def root_directory ::File.expand_path('../../../', __FILE__) end def local_storage ::File.join(working_directory, 'git_repo', '.git') end end.new LocalPac.config(config) valid_pac_file = <<-EOS function FindProxyForURL(url, host) { return "DIRECT"; } EOS git_repo = 'git_repo' FileUtils.rm_rf ::File.join(working_directory, git_repo) git_init(git_repo) git_set_author(git_repo) create_file(::File.join(git_repo, 'file.pac'), valid_pac_file) git_add(git_repo, 'file.pac') git_commit(git_repo) end end end end