diff options
author | Nanuk Krinner <nkrinner@suse.de> | 2013-07-05 13:06:03 +0200 |
---|---|---|
committer | Bryan McLellan <btm@getchef.com> | 2014-03-19 14:47:53 -0700 |
commit | 7efca14a59de55c241efb7b0a353c2bcd575347b (patch) | |
tree | f7102dbcf1e4149c0b5313940a041e75c7df2a18 /spec/unit/util/file_edit_spec.rb | |
parent | 861f2c7784b666313fafdb1d6b9d1ff1e426de33 (diff) | |
download | chef-7efca14a59de55c241efb7b0a353c2bcd575347b.tar.gz |
CHEF-3714 - Method returns if a file was edited
Implement a method in Chef::Util::FileEdit that returns if a file was edited
This commit contains the method originally written by rhafer@suse.com and
a unit test.
Diffstat (limited to 'spec/unit/util/file_edit_spec.rb')
-rw-r--r-- | spec/unit/util/file_edit_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/util/file_edit_spec.rb b/spec/unit/util/file_edit_spec.rb index 9acfb1baea..f85c588699 100644 --- a/spec/unit/util/file_edit_spec.rb +++ b/spec/unit/util/file_edit_spec.rb @@ -213,4 +213,11 @@ twice expect(edited_file_contents).to eq(append_twice) end end + + describe "file_edited" do + it "should return true if a file got edited" do + @fedit.insert_line_if_no_match(/pattern/, "new line inserted") + @fedit.file_edited?.should == true + end + end end |