File: test_construct.rb

package info (click to toggle)
ruby-test-construct 2.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 188 kB
  • sloc: ruby: 762; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require "tmpdir"

require "test_construct/version"
require "test_construct/helpers"
require "test_construct/pathname_extensions"

module TestConstruct

  CONTAINER_PREFIX = 'construct_container'

  def self.tmpdir
    dir = nil
    Dir.chdir Dir.tmpdir do dir = Dir.pwd end # HACK FOR OS X
    dir
  end

  def self.destroy_all!
    Pathname.glob(File.join(tmpdir, CONTAINER_PREFIX + "*")) do |container|
      container.rmtree
    end
  end

end