added some testing files and got some real tests to run
[rubygit.git] / tests / test_helper.rb
blob4a1cac9bd1fe7538d974550ead70de1c51c1aa5c
1 require 'test/unit'
2 require 'fileutils'
3 require File.dirname(__FILE__) + '/../lib/git'
5 class Test::Unit::TestCase
6   
7   def set_file_paths
8     @wdir = File.join(File.dirname(__FILE__), 'files', 'working')
9     @wbare = File.join(File.dirname(__FILE__), 'files', 'working.git')
10     @index = File.join(File.dirname(__FILE__), 'files', 'index')
11   end
12   
13   def in_temp_dir
14     filename = 'git_test' + Time.now.to_i.to_s + rand(300).to_s
15     tmp_path = File.join("/tmp/", filename)
16     FileUtils.mkdir(tmp_path)
17     Dir.chdir tmp_path do
18       yield tmp_path
19     end
20     FileUtils.rm_r(tmp_path)
21   end
22   
23 end