diff options
Diffstat (limited to 'spec/unit/util/file_edit_spec.rb')
-rw-r--r-- | spec/unit/util/file_edit_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/util/file_edit_spec.rb b/spec/unit/util/file_edit_spec.rb index 139b29d9ce..b99cf2f426 100644 --- a/spec/unit/util/file_edit_spec.rb +++ b/spec/unit/util/file_edit_spec.rb @@ -135,21 +135,21 @@ twice describe "search_file_replace" do it "should accept regex passed in as a string (not Regexp object) and replace the match if there is one" do fedit.search_file_replace("localhost", "replacement") - fedit.unwritten_changes?.should be_true + expect(fedit.unwritten_changes?).to be_truthy fedit.write_file expect(edited_file_contents).to eq(localhost_replaced) end it "should accept regex passed in as a Regexp object and replace the match if there is one" do fedit.search_file_replace(/localhost/, "replacement") - fedit.unwritten_changes?.should be_true + expect(fedit.unwritten_changes?).to be_truthy fedit.write_file expect(edited_file_contents).to eq(localhost_replaced) end it "should do nothing if there isn't a match" do fedit.search_file_replace(/pattern/, "replacement") - fedit.unwritten_changes?.should be_false + expect(fedit.unwritten_changes?).to be_falsey fedit.write_file expect(edited_file_contents).to eq(starting_content) end @@ -158,7 +158,7 @@ twice describe "search_file_replace_line" do it "should search for match and replace the whole line" do fedit.search_file_replace_line(/localhost/, "replacement line") - fedit.unwritten_changes?.should be_true + expect(fedit.unwritten_changes?).to be_truthy fedit.write_file expect(edited_file_contents).to eq(localhost_line_replaced) end @@ -167,7 +167,7 @@ twice describe "search_file_delete" do it "should search for match and delete the match" do fedit.search_file_delete(/localhost/) - fedit.unwritten_changes?.should be_true + expect(fedit.unwritten_changes?).to be_truthy fedit.write_file expect(edited_file_contents).to eq(localhost_deleted) end @@ -176,7 +176,7 @@ twice describe "search_file_delete_line" do it "should search for match and delete the matching line" do fedit.search_file_delete_line(/localhost/) - fedit.unwritten_changes?.should be_true + expect(fedit.unwritten_changes?).to be_truthy fedit.write_file expect(edited_file_contents).to eq(localhost_line_deleted) end @@ -185,7 +185,7 @@ twice describe "insert_line_after_match" do it "should search for match and insert the given line after the matching line" do fedit.insert_line_after_match(/localhost/, "new line inserted") - fedit.unwritten_changes?.should be_true + expect(fedit.unwritten_changes?).to be_truthy fedit.write_file expect(edited_file_contents).to eq(append_after_all_localhost) end @@ -194,14 +194,14 @@ twice describe "insert_line_if_no_match" do it "should search for match and insert the given line if no line match" do fedit.insert_line_if_no_match(/pattern/, "new line inserted") - fedit.unwritten_changes?.should be_true + expect(fedit.unwritten_changes?).to be_truthy fedit.write_file expect(edited_file_contents).to eq(append_after_content) end it "should do nothing if there is a match" do fedit.insert_line_if_no_match(/localhost/, "replacement") - fedit.unwritten_changes?.should be_false + expect(fedit.unwritten_changes?).to be_falsey fedit.write_file expect(edited_file_contents).to eq(starting_content) end @@ -218,7 +218,7 @@ twice it "should return true if a file got edited" do fedit.insert_line_if_no_match(/pattern/, "new line inserted") fedit.write_file - expect(fedit.file_edited?).to be_true + expect(fedit.file_edited?).to be_truthy end end end |