Sha256: 10ac0ac59ebce4a4fc6e620ba3e2ecf79912501dc285e0bb5614c28bc91fdc31

Contents?: true

Size: 949 Bytes

Versions: 9

Compression:

Stored size: 949 Bytes

Contents

require 'spec_helper'
require 'puppet/module_tool'

describe Puppet::ModuleTool::Tar::Solaris 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("gtar 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/solaris_spec.rb
puppet-3.3.1 spec/unit/module_tool/tar/solaris_spec.rb
puppet-3.3.1.rc3 spec/unit/module_tool/tar/solaris_spec.rb
puppet-3.3.1.rc2 spec/unit/module_tool/tar/solaris_spec.rb
puppet-3.3.1.rc1 spec/unit/module_tool/tar/solaris_spec.rb
puppet-3.3.0 spec/unit/module_tool/tar/solaris_spec.rb
puppet-3.3.0.rc3 spec/unit/module_tool/tar/solaris_spec.rb
puppet-3.3.0.rc2 spec/unit/module_tool/tar/solaris_spec.rb
puppet-3.2.4 spec/unit/module_tool/tar/solaris_spec.rb