forked from ConradIrwin/dotgpg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init
does not overide exist README.md.
When invoking `dotgpg init`, check if a README.md already exist. If so, do not create a README.md. This avoids overide exist README.md in the directory.
- Loading branch information
Showing
2 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,11 @@ | |
assert_equal $fixture.join("create-3", ".gpg", "[email protected]").read, GPGME::Key.find(:secret).first.export(armor: true).to_s | ||
end | ||
|
||
it "should not add a README if there is already one" do |variable| | ||
FileUtils.touch 'README.md' | ||
assert_not_equal File.read('README.md'), File.read($basic + 'README.md') | ||
end | ||
|
||
it "should fail if the .gpg directory already exists" do | ||
FileUtils.mkdir_p $fixture + "create-4" + ".gpg" | ||
assert_fails(/\.gpg already exists/) do | ||
|