summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Gerő <davidpgero@gmail.com>2016-10-29 12:51:01 +0200
committerDavid Gerő <davidpgero@gmail.com>2016-11-30 11:41:53 +0100
commit0fbb5a86dbe054af91c20d36697fda273445dd2a (patch)
tree5a00f01ccb6f26a75953f9d0d68ffcad0b87c220 /spec
parent50a410a977877dd44b1eaa078974c3a11ffd7475 (diff)
downloadgitlab-ce-0fbb5a86dbe054af91c20d36697fda273445dd2a.tar.gz
Add Human Readable Timestamp to backup tar file
Diffstat (limited to 'spec')
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index 287d83344db..2b244c13961 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -333,4 +333,35 @@ describe 'gitlab:app namespace rake task' do
expect { run_rake_task('gitlab:backup:restore') }.not_to raise_error
end
end
+
+ describe "Human Readable Backup Name" do
+ def tars_glob
+ Dir.glob(File.join(Gitlab.config.backup.path, '*_gitlab_backup.tar'))
+ end
+
+ before :all do
+ @origin_cd = Dir.pwd
+
+ reenable_backup_sub_tasks
+
+ FileUtils.rm tars_glob
+
+ # Redirect STDOUT and run the rake task
+ orig_stdout = $stdout
+ $stdout = StringIO.new
+ run_rake_task('gitlab:backup:create')
+ $stdout = orig_stdout
+
+ @backup_tar = tars_glob.first
+ end
+
+ after :all do
+ FileUtils.rm(@backup_tar)
+ Dir.chdir @origin_cd
+ end
+
+ it 'name has human readable time' do
+ expect(@backup_tar).to match(/\d+_\d{4}_\d{2}_\d{2}_gitlab_backup.tar$/)
+ end
+ end
end # gitlab:app namespace