require 'spec_helper' describe SoarAuthenticationToken::KeypairGenerator do before :each do @iut = SoarAuthenticationToken::KeypairGenerator.new end after :each do end it 'has a version number' do expect(SoarAuthenticationToken::VERSION).not_to be nil end context "when generating a new keypair" do it 'should provide the eliptic curve public and private key in pem format' do private_key, public_key = @iut.generate expect(private_key).to include('-----BEGIN EC PRIVATE KEY-----') expect(private_key).to include('-----END EC PRIVATE KEY-----') expect(public_key).to include('-----BEGIN PUBLIC KEY-----') expect(public_key).to include('-----END PUBLIC KEY-----') end end end