File: oauth2_spec.rb

package info (click to toggle)
ruby-oauth2 2.0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,196 kB
  • sloc: ruby: 5,441; javascript: 529; sh: 4; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 1,142 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
32
33
34
35
36
37
38
# frozen_string_literal: true

RSpec.describe OAuth2 do
  it "silence_extra_tokens_warning is a boolean" do
    expect(described_class.config.silence_extra_tokens_warning).to be(true).or be(false)
  end

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

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

    after do
      described_class.configure do |config|
        config.silence_extra_tokens_warning = false
        config.silence_no_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

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