diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-12 12:37:53 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-12 12:37:53 +0200 |
commit | 59b36f203274bedf6d455968d49af8fdba5e40ef (patch) | |
tree | 3e1d8fddc82b69d63b3f31ba87f71e34a99638a2 /spec/lib | |
parent | b1e425511fd9f79da5289f1651bb8e9397b384f5 (diff) | |
download | gitlab-ce-59b36f203274bedf6d455968d49af8fdba5e40ef.tar.gz |
Use gitlab-shell to move repos. Requires gitlab-shell v1.1.0
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/project_mover_spec.rb | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/spec/lib/project_mover_spec.rb b/spec/lib/project_mover_spec.rb deleted file mode 100644 index 9202befdcb2..00000000000 --- a/spec/lib/project_mover_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -require 'spec_helper' - -describe Gitlab::ProjectMover do - let(:base_path) { Rails.root.join('tmp', 'rspec-sandbox') } - - before do - FileUtils.rm_rf base_path if File.exists? base_path - FileUtils.mkdir_p base_path - - Gitlab.config.gitlab_shell.stub(repos_path: base_path) - - @project = create(:project) - end - - after do - FileUtils.rm_rf base_path - end - - it "should move project to subdir" do - mk_dir base_path, '', @project.path - mover = Gitlab::ProjectMover.new(@project, '', 'opensource') - - mover.execute.should be_true - moved?('opensource', @project.path).should be_true - end - - it "should move project from one subdir to another" do - mk_dir base_path, 'vsizov', @project.path - mover = Gitlab::ProjectMover.new(@project, 'vsizov', 'randx') - - mover.execute.should be_true - moved?('randx', @project.path).should be_true - end - - it "should move project from subdir to base" do - mk_dir base_path, 'vsizov', @project.path - mover = Gitlab::ProjectMover.new(@project, 'vsizov', '') - - mover.execute.should be_true - moved?('', @project.path).should be_true - end - - it "should raise if destination exists" do - mk_dir base_path, '', @project.path - mk_dir base_path, 'vsizov', @project.path - mover = Gitlab::ProjectMover.new(@project, 'vsizov', '') - - expect { mover.execute }.to raise_error(Gitlab::ProjectMover::ProjectMoveError) - end - - it "should raise if move failed" do - mk_dir base_path - mover = Gitlab::ProjectMover.new(@project, 'vsizov', '') - - expect { mover.execute }.to raise_error(Gitlab::ProjectMover::ProjectMoveError) - end - - - def mk_dir base_path, namespace = '', project_path = '' - FileUtils.mkdir_p File.join(base_path, namespace, project_path + ".git") - end - - def moved? namespace, path - File.exists?(File.join(base_path, namespace, path + '.git')) - end -end |