Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update spec-live

  • Loading branch information...
commit a22b0593ce2f2ce56cec5485614b642a12aa4144 1 parent 2c70c81
Brian D. Burns authored
Showing with 39 additions and 0 deletions.
  1. +9 −0 spec-live/backups/config.rb
  2. +30 −0 spec-live/compressor/custom_spec.rb
View
9 spec-live/backups/config.rb
@@ -101,6 +101,15 @@
store_with Local
end
+Backup::Model.new(:compressor_custom_archive_local, 'test_label') do
+ archive :test_archive, &archive_job
+ compress_with Custom do |c|
+ c.command = 'gzip -1'
+ c.extension = '.foo'
+ end
+ store_with Local
+end
+
Backup::Model.new(:notifier_mail, 'test_label') do
notify_by Mail
end
View
30 spec-live/compressor/custom_spec.rb
@@ -0,0 +1,30 @@
+# encoding: utf-8
+
+require File.expand_path('../../spec_helper.rb', __FILE__)
+
+describe 'Compressor::Custom' do
+
+ def archive_file_for(model)
+ File.join(
+ Backup::SpecLive::TMP_PATH,
+ "#{model.trigger}", model.time, "#{model.trigger}.tar"
+ )
+ end
+
+ def archive_contents_for(model)
+ archive_file = archive_file_for(model)
+ %x{ tar -tvf #{archive_file} }
+ end
+
+ it 'should compress an archive' do
+ model = h_set_trigger('compressor_custom_archive_local')
+ model.perform!
+ archive_file = archive_file_for(model)
+ File.exist?(archive_file).should be_true
+ archive_contents_for(model).should match(
+ /compressor_custom_archive_local\/archives\/test_archive\.tar\.foo/
+ )
+ File.stat(archive_file).size.should be > 0
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.