File: oauth2_spec.rb

package info (click to toggle)
ruby-oauth2 2.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 644 kB
  • sloc: ruby: 3,763; makefile: 4; sh: 4
file content (31 lines) | stat: -rw-r--r-- 820 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

RSpec.describe OAuth2 do
  it 'has a default config for silence_extra_tokens_warning' do
    expect(described_class.config.silence_extra_tokens_warning).to eq(false)
  end

  describe '.configure' do
    subject(:configure) do
      described_class.configure do |config|
        config.silence_extra_tokens_warning = true
      end
    end

    before do
      described_class.configure do |config|
        config.silence_extra_tokens_warning = false
      end
    end

    after do
      described_class.configure do |config|
        config.silence_extra_tokens_warning = false
      end
    end

    it 'can change setting of silence_extra_tokens_warning' do
      block_is_expected.to change(described_class.config, :silence_extra_tokens_warning).from(false).to(true)
    end
  end
end