Puppet: System Administration Automated

Support

Ticket #872: file-replace-false-test.patch

File file-replace-false-test.patch, 0.9 kB (added by ctrlaltdel, 1 year ago)
  • a/test/ral/types/file.rb

    old new  
    15311531        file[:replace] = :no 
    15321532        assert_equal(:false, file[:replace], ":replace did not alias :false to :no") 
    15331533    end 
     1534 
     1535    # #872 -- "replace=>false" file attribute is not handled when using content 
     1536    def test_replace_false 
     1537        # Create a file which should not be replaced 
     1538        file = Puppet::Type.newfile :path => tempfile(), :replace => :false, :content => "foo" 
     1539        assert_apply(file) 
     1540 
     1541        property = file.property(:content) 
     1542        assert(property, "did not get content property") 
     1543 
     1544        # make sure it doesn't get out of sync 
     1545        assert(property.insync?("bar"), "File did get out of sync") 
     1546    end 
    15341547     
    15351548    # #365 -- make sure generated files also use filebuckets. 
    15361549    def test_recursive_filebuckets