diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-02-24 22:16:04 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 16:40:41 +0300 |
commit | 0668521b2b8ed32f4a3f192a8ad04c64f6c1c0cd (patch) | |
tree | 6c3a1266ae720bb04bde8d67afe26a6ade3c061d /spec/lib/gitlab/gpg_spec.rb | |
parent | 0e3d3d60bae48f3698f9e7b0e060edb67170b11e (diff) |
move current keychain methods to namespace
Diffstat (limited to 'spec/lib/gitlab/gpg_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gpg_spec.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/lib/gitlab/gpg_spec.rb b/spec/lib/gitlab/gpg_spec.rb index 2a55e7d89de..c0df719c0c2 100644 --- a/spec/lib/gitlab/gpg_spec.rb +++ b/spec/lib/gitlab/gpg_spec.rb @@ -28,37 +28,37 @@ describe Gitlab::Gpg do ).to eq [] end end +end + +describe Gitlab::Gpg::CurrentKeyChain, :gpg do + describe '.emails' do + it 'returns the emails' do + Gitlab::Gpg::CurrentKeyChain.add(GpgHelpers::User2.public_key) + + expect( + described_class.emails(GpgHelpers::User2.fingerprint) + ).to match_array GpgHelpers::User2.emails + end + end - describe '.add_to_keychain', :gpg do + describe '.add', :gpg do it 'stores the key in the keychain' do expect(GPGME::Key.find(:public, GpgHelpers::User1.fingerprint)).to eq [] - Gitlab::Gpg.add_to_keychain(GpgHelpers::User1.public_key) + Gitlab::Gpg::CurrentKeyChain.add(GpgHelpers::User1.public_key) expect(GPGME::Key.find(:public, GpgHelpers::User1.fingerprint)).not_to eq [] end end - describe '.remove_from_keychain', :gpg do + describe '.remove', :gpg do it 'removes the key from the keychain' do - Gitlab::Gpg.add_to_keychain(GpgHelpers::User1.public_key) + Gitlab::Gpg::CurrentKeyChain.add(GpgHelpers::User1.public_key) expect(GPGME::Key.find(:public, GpgHelpers::User1.fingerprint)).not_to eq [] - Gitlab::Gpg.remove_from_keychain(GpgHelpers::User1.fingerprint) + Gitlab::Gpg::CurrentKeyChain.remove(GpgHelpers::User1.fingerprint) expect(GPGME::Key.find(:public, GpgHelpers::User1.fingerprint)).to eq [] end end end - -describe Gitlab::Gpg::CurrentKeyChain, :gpg do - describe '.emails' do - it 'returns the emails' do - Gitlab::Gpg.add_to_keychain(GpgHelpers::User2.public_key) - - expect( - described_class.emails(GpgHelpers::User2.fingerprint) - ).to match_array GpgHelpers::User2.emails - end - end -end |