each test file that clones a repo gets its own repo path

This commit is contained in:
rick
2010-12-21 10:37:04 -08:00
parent 58a680ab6d
commit 491eee7ebd
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -22,11 +22,12 @@ def testpath(path)
end end
def cloned_testpath(path) def cloned_testpath(path)
path = testpath(path) repo = File.expand_path(testpath(path))
cloned = path.chomp('.git') path = File.dirname(repo)
FileUtils.rm_rf cloned cloned = File.join(path, self.class.name)
Dir.chdir(File.expand_path(File.dirname(path))) do FileUtils.rm_rf(cloned)
%x{git clone #{File.basename(path)}} Dir.chdir(path) do
%x{git clone #{File.basename(repo)} #{self.class.name}}
end end
cloned cloned
end end
+1 -1
View File
@@ -8,7 +8,7 @@ context "Page Reverting" do
end end
teardown do teardown do
FileUtils.rm_rf @path FileUtils.rm_rf(@path)
end end
test "reverts single commit" do test "reverts single commit" do