diff options
| author | Luke Kanies <luke@madstop.com> | 2008-10-28 18:09:55 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-11-04 16:20:45 -0600 |
| commit | 05e1325891b2ab22088dcd34dd54e4afcbf59ddb (patch) | |
| tree | 46f28ce17354bac900ba513402dc94e889ab7b4e /test | |
| parent | 6f7ccff8bb764dffd1d41d5391dd79f7bd4a387c (diff) | |
| download | puppet-05e1325891b2ab22088dcd34dd54e4afcbf59ddb.tar.gz puppet-05e1325891b2ab22088dcd34dd54e4afcbf59ddb.tar.xz puppet-05e1325891b2ab22088dcd34dd54e4afcbf59ddb.zip | |
Moving a file purging test to rspec
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'test')
| -rwxr-xr-x | test/ral/type/file.rb | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/test/ral/type/file.rb b/test/ral/type/file.rb index df0f849f2..c0c644dc0 100755 --- a/test/ral/type/file.rb +++ b/test/ral/type/file.rb @@ -955,48 +955,6 @@ class TestFile < Test::Unit::TestCase assert_equal("yayness", File.read(path), "Content did not get set correctly") end - # Make sure unmanaged files are purged. - def test_purge - sourcedir = tempfile() - destdir = tempfile() - Dir.mkdir(sourcedir) - Dir.mkdir(destdir) - sourcefile = File.join(sourcedir, "sourcefile") - dsourcefile = File.join(destdir, "sourcefile") - localfile = File.join(destdir, "localfile") - purgee = File.join(destdir, "to_be_purged") - File.open(sourcefile, "w") { |f| f.puts "funtest" } - # this file should get removed - File.open(purgee, "w") { |f| f.puts "footest" } - - lfobj = Puppet::Type.newfile( - :title => "localfile", - :path => localfile, - :content => "rahtest", - :ensure => :file, - :backup => false - ) - - destobj = Puppet::Type.newfile(:title => "destdir", :path => destdir, - :source => sourcedir, - :backup => false, - :recurse => true) - - config = mk_catalog(lfobj, destobj) - config.apply - - assert(FileTest.exists?(dsourcefile), "File did not get copied") - assert(FileTest.exists?(localfile), "Local file did not get created") - assert(FileTest.exists?(purgee), "Purge target got prematurely purged") - - assert_nothing_raised { destobj[:purge] = true } - config.apply - - assert(FileTest.exists?(localfile), "Local file got purged") - assert(FileTest.exists?(dsourcefile), "Source file got purged") - assert(! FileTest.exists?(purgee), "File did not get purged") - end - # Testing #274. Make sure target can be used without 'ensure'. def test_target_without_ensure source = tempfile() |
