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

Version Path
dry-web-web_pipe-0.2.0 spec/support/directories.rb
dry-web-roda-0.13.1 spec/support/directories.rb
dry-web-roda-0.13.0 spec/support/directories.rb
dry-web-web_pipe-0.1.0 spec/support/directories.rb
dry-web-roda-0.12.0 spec/support/directories.rb
dry-web-roda-0.11.0 spec/support/directories.rb
dry-web-roda-0.10.0 spec/support/directories.rb
dry-web-roda-0.9.1 spec/support/directories.rb
dry-web-roda-0.9.0 spec/support/directories.rb
dry-web-roda-0.8.0 spec/support/directories.rb
dry-web-roda-0.7.5 spec/support/directories.rb
dry-web-roda-0.7.4 spec/support/directories.rb
dry-web-roda-0.7.3 spec/support/directories.rb
dry-web-roda-0.7.2 spec/support/directories.rb
dry-web-roda-0.7.1 spec/support/directories.rb
dry-web-roda-0.7.0 spec/support/directories.rb
dry-web-roda-0.6.3 spec/support/directories.rb
dry-web-roda-0.6.2 spec/support/directories.rb
dry-web-roda-0.6.1 spec/support/directories.rb