diff options
author | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-07 17:19:09 -0800 |
---|---|---|
committer | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-07 17:19:09 -0800 |
commit | 169381bbce998807c119f291d69b8ae1d8fb5785 (patch) | |
tree | b11162f2cce510963ed0420c719f7bd366762d57 /tests/test_helper.rb | |
parent | 6c7d8b50b2091a0e5deb80e20260e24ad846b1fd (diff) | |
download | third_party-ruby-git-169381bbce998807c119f291d69b8ae1d8fb5785.tar.gz third_party-ruby-git-169381bbce998807c119f291d69b8ae1d8fb5785.tar.xz third_party-ruby-git-169381bbce998807c119f291d69b8ae1d8fb5785.zip |
added some testing files and got some real tests to run
Diffstat (limited to 'tests/test_helper.rb')
-rw-r--r-- | tests/test_helper.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_helper.rb b/tests/test_helper.rb index 2216f60..4a1cac9 100644 --- a/tests/test_helper.rb +++ b/tests/test_helper.rb @@ -1,2 +1,23 @@ require 'test/unit' +require 'fileutils' require File.dirname(__FILE__) + '/../lib/git' + +class Test::Unit::TestCase + + def set_file_paths + @wdir = File.join(File.dirname(__FILE__), 'files', 'working') + @wbare = File.join(File.dirname(__FILE__), 'files', 'working.git') + @index = File.join(File.dirname(__FILE__), 'files', 'index') + end + + def in_temp_dir + filename = 'git_test' + Time.now.to_i.to_s + rand(300).to_s + tmp_path = File.join("/tmp/", filename) + FileUtils.mkdir(tmp_path) + Dir.chdir tmp_path do + yield tmp_path + end + FileUtils.rm_r(tmp_path) + end + +end
\ No newline at end of file |