Sha256: da86889c45baddb9c4e392017cfd4e48c95d61dc946cba911aa9ca9a0c0f76a4

Contents?: true

Size: 944 Bytes

Versions: 9

Compression:

Stored size: 944 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-permissions --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 644 {} +")
    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

9 entries across 9 versions & 1 rubygems

Version Path
puppet-3.3.2 spec/unit/module_tool/tar/gnu_spec.rb
puppet-3.3.1 spec/unit/module_tool/tar/gnu_spec.rb
puppet-3.3.1.rc3 spec/unit/module_tool/tar/gnu_spec.rb
puppet-3.3.1.rc2 spec/unit/module_tool/tar/gnu_spec.rb
puppet-3.3.1.rc1 spec/unit/module_tool/tar/gnu_spec.rb
puppet-3.3.0 spec/unit/module_tool/tar/gnu_spec.rb
puppet-3.3.0.rc3 spec/unit/module_tool/tar/gnu_spec.rb
puppet-3.3.0.rc2 spec/unit/module_tool/tar/gnu_spec.rb
puppet-3.2.4 spec/unit/module_tool/tar/gnu_spec.rb