Sha256: f99a54ecf08d5f61d366dbf79105dbbaa41890eeaec22f82540db3f3ed332a7a

Contents?: true

Size: 987 Bytes

Versions: 12

Compression:

Stored size: 987 Bytes

Contents

# encoding: utf-8
require_relative File.expand_path('../../../spec/support/git', __FILE__)

module LocalPac
  class FileServer
    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)
        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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
local_pac-0.1.11 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.10 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.9 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.8 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.7 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.6 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.5 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.4 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.3 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.2 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.1 lib/local_pac/spec_helper_file_server.rb
local_pac-0.1.0 lib/local_pac/spec_helper_file_server.rb