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.
- Loading branch information
1 parent
fc4a478
commit 2846396
Showing
3 changed files
with
12 additions
and
8 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
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 |
---|---|---|
|
@@ -66,7 +66,7 @@ | |
Dir.chdir @path do | ||
@dotgpg.invoke(:add, [key_path]) | ||
end | ||
assert Dotgpg::Dir.new(@path).has_key? Dotgpg.read_key(File.open(key_path)) | ||
assert Dotgpg::Dir.new(@path).has_key? Dotgpg.read_key(File.read(key_path)) | ||
end | ||
|
||
it "should abort if the current working directory is not dotgpg" do | ||
|
@@ -120,14 +120,14 @@ | |
Dir.chdir @path do | ||
@dotgpg.invoke :rm, [".gpg/[email protected]"] | ||
end | ||
refute Dotgpg::Dir.new(@path).has_key? Dotgpg.read_key(File.open($fixture + "add1.key")) | ||
refute Dotgpg::Dir.new(@path).has_key? Dotgpg.read_key(File.read($fixture + "add1.key")) | ||
end | ||
|
||
it "should find the key by email" do | ||
Dir.chdir @path do | ||
@dotgpg.invoke :rm, ["[email protected]"] | ||
end | ||
refute Dotgpg::Dir.new(@path).has_key? Dotgpg.read_key(File.open($fixture + "add1.key")) | ||
refute Dotgpg::Dir.new(@path).has_key? Dotgpg.read_key(File.read($fixture + "add1.key")) | ||
end | ||
|
||
it "should abort if the key doesn't exist" do | ||
|
@@ -153,7 +153,7 @@ | |
end | ||
|
||
it "should remove a secret key if --force is given" do | ||
key = Dotgpg.read_key(File.open(@path + ".gpg" + "[email protected]")) | ||
key = Dotgpg.read_key(File.read(@path + ".gpg" + "[email protected]")) | ||
Dir.chdir @path do | ||
@dotgpg.invoke :rm, ["[email protected]"], force: true | ||
end | ||
|