title: Chef FileEdit keep creating new file
body: <p>i have a simple insert_line_if_no_match in my recipe that seems to keep re-creating the file in each subsequent chef-client run. </p>
  
  <p>after reading the rubydoc page of FileEdit, it says it will only write a new file if the file has changed but this doesn’t seem to be true.</p>
  
  <p>anyone else have this problem?</p>
  
  <p>ruby_block “provide_useful_default_prompt" do</p>
  
  <pre><code>block do
      profile = Chef::Util::FileEdit.new("/etc/profile")
      profile.insert_line_if_no_match(/PS1/, "\nPS1='[\\! (\\h):\\W] '\n")
      profile.write_file
  end
  </code></pre>
  
  <p>end</p>
  
  <p>more /etc/profile | grep PS1</p>
  
  <p>PS1='[! (\h):\W] '
  end</p>