File: 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 (19 lines) | stat: -rw-r--r-- 576 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

RSpec.describe JWT do
  describe 'JWT.configure' do
    it 'yields the configuration' do
      expect { |b| described_class.configure(&b) }.to yield_with_args(described_class.configuration)
    end

    it 'allows configuration to be changed via the block' do
      expect(described_class.configuration.decode.verify_expiration).to eq(true)

      described_class.configure do |config|
        config.decode.verify_expiration = false
      end

      expect(described_class.configuration.decode.verify_expiration).to eq(false)
    end
  end
end