tests seed
This commit is contained in:
parent
035196e7a8
commit
d7ea9052f1
3 changed files with 10 additions and 7 deletions
|
@ -1,8 +1,11 @@
|
||||||
# Clone repo
|
# Create dir for test repo
|
||||||
`cp spec/seed_project.tar.gz /tmp/`
|
repo_dir = File.join(Rails.root, "tmp", "tests")
|
||||||
Dir.chdir("/tmp")
|
Dir.mkdir(repo_dir) unless File.exists?(repo_dir)
|
||||||
|
|
||||||
|
`cp spec/seed_project.tar.gz tmp/tests/`
|
||||||
|
Dir.chdir(repo_dir)
|
||||||
`tar -xf seed_project.tar.gz`
|
`tar -xf seed_project.tar.gz`
|
||||||
3.times do |i|
|
3.times do |i|
|
||||||
`cp -r /tmp/legit/ /tmp/legit_#{i}/`
|
`cp -r legit/ legit_#{i}/`
|
||||||
puts "Unpacked seed repo - /tmp/legit_#{i}"
|
puts "Unpacked seed repo - tmp/tests/legit_#{i}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,7 +38,7 @@ describe Project do
|
||||||
|
|
||||||
it "should return path to repo" do
|
it "should return path to repo" do
|
||||||
project = Project.new(:path => "somewhere")
|
project = Project.new(:path => "somewhere")
|
||||||
project.path_to_repo.should == "/tmp/somewhere"
|
project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere")
|
||||||
end
|
end
|
||||||
|
|
||||||
describe :valid_repo? do
|
describe :valid_repo? do
|
||||||
|
|
|
@ -10,7 +10,7 @@ class Project
|
||||||
end
|
end
|
||||||
|
|
||||||
def path_to_repo
|
def path_to_repo
|
||||||
"/tmp/" + path
|
File.join(Rails.root, "tmp", "tests", path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue