1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
require 'fileutils'
require 'pathname'
module Buff::Ignore
module RSpec
module PathHelpers
# The tmp path where testing support/workspaces are
#
# @return [Pathname]
def tmp_path
@_tmp_path ||= app_root.join('tmp').expand_path
end
private
# The "root" of berkshelf
#
# @return [Pathname]
def app_root
@_app_root ||= Pathname.new(File.expand_path('../../..', __FILE__))
end
# Clean the temporary directories
def clean_tmp_path!
FileUtils.rm_rf(tmp_path)
FileUtils.mkdir_p(tmp_path)
end
end
end
end
|