Sha256: 4ca5b238978552d6a7259199b4ee501e03e0c9862aca229339343a6c474b9672

Contents?: true

Size: 764 Bytes

Versions: 18

Compression:

Stored size: 764 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'

require 'puppet_spec/files'
require 'puppet/file_bucket/dipper'

describe Puppet::Type.type(:tidy) do
  include PuppetSpec::Files

  before do
    Puppet::Util::Storage.stubs(:store)
  end

  # Testing #355.
  it "should be able to remove dead links", :if => Puppet.features.manages_symlinks? do
    dir = tmpfile("tidy_link_testing")
    link = File.join(dir, "link")
    target = tmpfile("no_such_file_tidy_link_testing")
    Dir.mkdir(dir)
    Puppet::FileSystem.symlink(target, link)

    tidy = Puppet::Type.type(:tidy).new :path => dir, :recurse => true

    catalog = Puppet::Resource::Catalog.new
    catalog.add_resource(tidy)

    catalog.apply

    Puppet::FileSystem.symlink?(link).should be_false
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
puppet-3.6.2 spec/integration/type/tidy_spec.rb
puppet-3.6.2-x86-mingw32 spec/integration/type/tidy_spec.rb
puppet-3.6.1 spec/integration/type/tidy_spec.rb
puppet-3.6.1-x86-mingw32 spec/integration/type/tidy_spec.rb
puppet-3.6.0 spec/integration/type/tidy_spec.rb
puppet-3.6.0-x86-mingw32 spec/integration/type/tidy_spec.rb
puppet-3.6.0.rc1 spec/integration/type/tidy_spec.rb
puppet-3.6.0.rc1-x86-mingw32 spec/integration/type/tidy_spec.rb
puppet-3.5.1 spec/integration/type/tidy_spec.rb
puppet-3.5.1-x86-mingw32 spec/integration/type/tidy_spec.rb
puppet-3.5.1.rc1 spec/integration/type/tidy_spec.rb
puppet-3.5.1.rc1-x86-mingw32 spec/integration/type/tidy_spec.rb
puppet-3.5.0.rc3 spec/integration/type/tidy_spec.rb
puppet-3.5.0.rc3-x86-mingw32 spec/integration/type/tidy_spec.rb
puppet-3.5.0.rc2 spec/integration/type/tidy_spec.rb
puppet-3.5.0.rc2-x86-mingw32 spec/integration/type/tidy_spec.rb
puppet-3.5.0.rc1 spec/integration/type/tidy_spec.rb
puppet-3.5.0.rc1-x86-mingw32 spec/integration/type/tidy_spec.rb