Sha256: df7bdfe435574b00ce5993fa8525b495347dfedd736d2ec30e5474894302caae

Contents?: true

Size: 1.33 KB

Versions: 28

Compression:

Stored size: 1.33 KB

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::Engine do
  [:bookmarks_http_method, :email_regexp, :facet_missing_param, :sms_mappings].each do |dep_key|
    describe "config.#{dep_key}" do
      subject { described_class.config }

      let(:unlikely_value) { 'unlikely value' }

      it 'is deprecated' do
        allow(Deprecation).to receive(:warn)
        subject.send(dep_key)
        expect(Deprecation).to have_received(:warn)
      end

      it 'delegates to config.blacklight' do
        allow(subject.blacklight).to receive(dep_key).and_return(unlikely_value)
        expect(subject.send(dep_key)).to eql(unlikely_value)
      end
    end

    describe "config.#{dep_key}=" do
      subject { described_class.config }

      let(:unlikely_value) { 'unlikely value' }

      it 'is deprecated' do
        allow(Deprecation).to receive(:warn)
        allow(subject.blacklight).to receive(:"#{dep_key}=").with(unlikely_value)
        subject.send(:"#{dep_key}=", unlikely_value)
        expect(Deprecation).to have_received(:warn)
      end

      it 'delegates to config.blacklight' do
        allow(subject.blacklight).to receive(:"#{dep_key}=").with(unlikely_value)
        subject.send(:"#{dep_key}=", unlikely_value)
        expect(subject.blacklight).to have_received(:"#{dep_key}=").with(unlikely_value)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.39.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.38.0 spec/lib/blacklight/engine_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/lib/blacklight/engine_spec.rb
blacklight-7.37.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.36.2 spec/lib/blacklight/engine_spec.rb
blacklight-7.36.1 spec/lib/blacklight/engine_spec.rb
blacklight-7.36.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.35.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.34.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.33.1 spec/lib/blacklight/engine_spec.rb
blacklight-7.33.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.32.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.31.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.30.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.29.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.28.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.27.1 spec/lib/blacklight/engine_spec.rb
blacklight-7.27.0 spec/lib/blacklight/engine_spec.rb
blacklight-7.26.1 spec/lib/blacklight/engine_spec.rb