File: condition_spec.rb

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

RSpec.describe DeclarativePolicy::Condition do
  subject(:condition) { described_class.new(name, opts, &compute_block) }

  let(:name) { 'condition_name' }
  let(:opts) { {} }
  let(:compute_block) { proc {} }

  describe 'deprecations' do
    let(:opts) { { scope: :normal } }

    it 'deprecates :normal scope' do
      notice = "[DEPRECATION] `:normal` is deprecated and will be removed in 2.0. " \
               "Please use new name `:user_and_subject`\n"

      expect { condition }.to output(notice).to_stderr
    end
  end
end