Sha256: 6769c3e81e8c22f1cf14df14281fe98900bafd1503042270cc8617d1ae88ef7a
Contents?: true
Size: 670 Bytes
Versions: 19
Compression:
Stored size: 670 Bytes
Contents
require "fileutils" module RSpec module Support module Directory private def with_directory(directory) current = Dir.pwd target = Pathname.new(Dir.pwd).join(directory) Dir.chdir(target) yield ensure Dir.chdir(current) end def with_tmp_directory dir = Pathname.new("tmp").join("aruba") with_directory(dir) do yield end ensure FileUtils.rm_rf(dir) end end end end RSpec.configure do |config| config.include RSpec::Support::Directory, type: :cli config.before :suite do Pathname.new(Dir.pwd).join("tmp").mkpath end end
Version data entries
19 entries across 19 versions & 2 rubygems