Sha256: e5c3c12db1c52d76b3ad274828ccd9e60941fd1a3d2369eb84893a1dd35e5ebb

Contents?: true

Size: 660 Bytes

Versions: 10

Compression:

Stored size: 660 Bytes

Contents

require 'fileutils'

module TestHelper

def create_rim_info(dir, attrs)
  FileUtils.mkdir_p dir
  ri = RIM::RimInfo.new
  attrs.each_pair do |k,v|
    ri.send("#{k}=", v)
  end
  ri.to_dir(dir)
end

def empty_test_dir(dir)
  # create directory in test folder
  dir = File.dirname(__FILE__)+"/"+dir
  rm_rf(dir)
  mkdir_p(dir)
  @test_dirs ||= []
  @test_dirs << dir
  dir
end

def write_file(path, content)
  FileUtils.mkdir_p File.dirname(path)
  File.open(path, "w") do |f| 
    f.write content
  end
end

def remove_test_dirs
  @test_dirs ||= []
  @test_dirs.each do |d|
    rm_rf(d)
  end
  @test_dirs = nil
end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
esr-rim-1.3.5 test/test_helper.rb
esr-rim-1.3.4 test/test_helper.rb
esr-rim-1.3.3 test/test_helper.rb
esr-rim-1.3.2 test/test_helper.rb
esr-rim-1.3.1 test/test_helper.rb
esr-rim-1.3.0 test/test_helper.rb
esr-rim-1.2.2 test/test_helper.rb
esr-rim-1.2.1 test/test_helper.rb
esr-rim-1.2.0 test/test_helper.rb
esr-rim-1.1.5 test/test_helper.rb