Sha256: 3ba3cf8b45c6795e29a207ab9b8f4eb582648e20b3ecc157fea428cce6375e4f
Contents?: true
Size: 1.41 KB
Versions: 14
Compression:
Stored size: 1.41 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../example_helper') describe Astrails::Safe::Gzip do def def_backup { :compressed => false, :command => "command", :extension => ".foo", :filename => "qweqwe" } end after(:each) { Astrails::Safe::TmpFile.cleanup } def gzip(config = {}, backup = def_backup) Astrails::Safe::Gzip.new( @config = Astrails::Safe::Config::Node.new(nil, config), @backup = Astrails::Safe::Backup.new(backup) ) end describe :preocess do describe "when not yet compressed" do before(:each) { @gzip = gzip } it "should add .gz extension" do mock(@backup.extension) << '.gz' @gzip.process end it "should add |gzip pipe" do mock(@backup.command) << '|gzip' @gzip.process end it "should set compressed" do mock(@backup).compressed = true @gzip.process end end describe "when already compressed" do before(:each) { @gzip = gzip({}, :compressed => true) } it "should not touch extension" do dont_allow(@backup.extension).<< anything @gzip.process end it "should not touch command" do dont_allow(@backup.command).<< anything @gzip.process end it "should not touch compressed" do dont_allow(@backup).compressed = anything @gzip.process end end end end
Version data entries
14 entries across 14 versions & 3 rubygems