File: jwk_configuration_spec.rb

package info (click to toggle)
ruby-jwt 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 876 kB
  • sloc: ruby: 5,550; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 595 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

RSpec.describe JWT::Configuration::JwkConfiguration do
  describe '.kid_generator_type=' do
    context 'when invalid value is passed' do
      it 'raises ArgumentError' do
        expect { subject.kid_generator_type = :foo }.to raise_error(ArgumentError, 'foo is not a valid kid generator type.')
      end
    end

    context 'when valid value is passed' do
      it 'sets the generator matching the value' do
        subject.kid_generator_type = :rfc7638_thumbprint
        expect(subject.kid_generator).to eq(JWT::JWK::Thumbprint)
      end
    end
  end
end