gpg_spec: switch structure to if/else instead of rescue

This commit is contained in:
JCount 2017-04-04 17:25:54 -04:00
parent 239b873fb2
commit 14a7ef591b

View File

@ -12,11 +12,13 @@ describe Gpg do
shutup do shutup do
subject.create_test_key(dir) subject.create_test_key(dir)
gpg = subject::GPG_EXECUTABLE
@version = Utils.popen_read(gpg, "--version")[/\d\.\d/, 0]
end end
begin if @version.to_s.start_with?("2.1")
expect(dir/".gnupg/pubring.kbx").to be_file expect(dir/".gnupg/pubring.kbx").to be_file
rescue RSpec::Expectations::ExpectationNotMetError else
expect(dir/".gnupg/secring.gpg").to be_file expect(dir/".gnupg/secring.gpg").to be_file
end end
end end