Sha256: 64b84e2b075cc9d4646438318cf933337e4a24ab7e0c9161a9ece0252b2ccf3b
Contents?: true
Size: 641 Bytes
Versions: 3
Compression:
Stored size: 641 Bytes
Contents
# frozen_string_literal: true require 'securerandom' require 'fileutils' UNIQUE_FILES_DIR = './test/unique_files' def require_unique_file(file = 'dog.rb') uuid = SecureRandom.uuid dir = "#{UNIQUE_FILES_DIR}/#{uuid}" temp_file = "#{dir}/#{file}" FileUtils.mkdir_p(Pathname.new(temp_file).dirname.to_s) File.open(temp_file, 'w') { |w| w.write(File.read("./test/#{file}")) } require temp_file Coverband::Utils::FilePathHelper.full_path_to_relative(File.expand_path(temp_file)) end def remove_unique_files FileUtils.rm_r(UNIQUE_FILES_DIR) if File.exist?(UNIQUE_FILES_DIR) end Minitest.after_run do remove_unique_files end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
coverband-4.2.1.rc3 | test/unique_files.rb |
coverband-4.2.1.rc2 | test/unique_files.rb |
coverband-4.2.1.rc1 | test/unique_files.rb |