Skip to content

Commit 15bd1db

Browse files
author
Nuo Yan
committed
updated FileEdit_spec.rb
1 parent 8c7941e commit 15bd1db

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

chef/lib/chef/util/spec/FileEdit/FileEdit_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,21 @@ def helper_method(filename, regex, value)
5555
fedit.write_file
5656
newfile = File.new("./spec/FileEdit/hosts").readlines
5757
newfile[0].should match(/replacement/)
58+
newfile[0].should_not match(/127/)
5859
File.delete("./spec/FileEdit/hosts")
5960
File.rename("./spec/FileEdit/hosts.old", "./spec/FileEdit/hosts")
6061
end
6162

6263
end
6364

64-
6565
describe FileEdit, "search_file_delete" do
6666
it "should search for match and delete the match" do
6767
fedit = FileEdit.new("./spec/FileEdit/hosts")
6868
fedit.search_file_delete(/localhost/)
6969
fedit.write_file
7070
newfile = File.new("./spec/FileEdit/hosts").readlines
7171
newfile[0].should_not match(/localhost/)
72+
newfile[0].should match(/127/)
7273
File.delete("./spec/FileEdit/hosts")
7374
File.rename("./spec/FileEdit/hosts.old", "./spec/FileEdit/hosts")
7475
end

0 commit comments

Comments
 (0)