summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-09 12:11:35 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-09 12:11:35 +0200
commit4612599e5eb94e09f539a3fbbc3a1eaeaa96a3c7 (patch)
tree0ed68f260d76e862ecee78ed910fe1150093f3b9 /spec
parent64f60340918d3f4aa3c1d33b89d8dc90bcd96de7 (diff)
downloadgitlab-ce-4612599e5eb94e09f539a3fbbc3a1eaeaa96a3c7.tar.gz
Remove rake task re-enabling into a method
Diffstat (limited to 'spec')
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index 7f0396795b8..ec06670ba19 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -73,6 +73,12 @@ describe 'gitlab:app namespace rake task' do
@backup_tar = (tars_glob - existing_tars).first
end
+ def reenable_backup_sub_tasks
+ Rake::Task["gitlab:backup:db:create"].reenable
+ Rake::Task["gitlab:backup:repo:create"].reenable
+ Rake::Task["gitlab:backup:uploads:create"].reenable
+ end
+
before :all do
create_backup
end
@@ -93,13 +99,9 @@ describe 'gitlab:app namespace rake task' do
# We created a backup in a before(:all) so it got the default permissions.
# We now need to do some work to create a _new_ backup file using our stub.
FileUtils.rm(@backup_tar)
- Rake::Task["gitlab:backup:db:create"].reenable
- Rake::Task["gitlab:backup:repo:create"].reenable
- Rake::Task["gitlab:backup:uploads:create"].reenable
+ reenable_backup_sub_tasks
create_backup
- Rake::Task["gitlab:backup:db:create"].reenable
- Rake::Task["gitlab:backup:repo:create"].reenable
- Rake::Task["gitlab:backup:uploads:create"].reenable
+ reenable_backup_sub_tasks
end
it 'uses the custom permissions' do