Sha256: 1ce1e327480a9e28c1e6751ca14974fd86577163a7a19241cf535836877ed257
Contents?: true
Size: 924 Bytes
Versions: 16
Compression:
Stored size: 924 Bytes
Contents
require 'spec_helper' require 'puppet/module_tool' describe Puppet::ModuleTool::Tar::Gnu do let(:sourcefile) { '/the/module.tar.gz' } let(:destdir) { '/the/dest/dir' } let(:sourcedir) { '/the/src/dir' } let(:destfile) { '/the/dest/file.tar.gz' } it "unpacks a tar file" do Puppet::Util::Execution.expects(:execute).with("tar xzf #{sourcefile} --no-same-owner -C #{destdir}") Puppet::Util::Execution.expects(:execute).with("find #{destdir} -type d -exec chmod 755 {} +") Puppet::Util::Execution.expects(:execute).with("find #{destdir} -type f -exec chmod a-wst {} +") Puppet::Util::Execution.expects(:execute).with("chown -R <owner:group> #{destdir}") subject.unpack(sourcefile, destdir, '<owner:group>') end it "packs a tar file" do Puppet::Util::Execution.expects(:execute).with("tar cf - #{sourcedir} | gzip -c > #{destfile}") subject.pack(sourcedir, destfile) end end
Version data entries
16 entries across 16 versions & 1 rubygems