logstash-core/spec/logstash/inputs/base_spec.rb [89:118]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    context 'execution_context=' do
      let(:deprecation_logger_stub) { double('DeprecationLogger').as_null_object }
      before(:each) do
        allow(klass).to receive(:deprecation_logger).and_return(deprecation_logger_stub)
      end

      it "allow to set the context" do
        new_ctx = execution_context.dup
        subject.execution_context = new_ctx
        expect(subject.execution_context).to be(new_ctx)
      end

      it "propagate the context to the codec" do
        new_ctx = execution_context.dup
        expect(instance.codec.execution_context).to_not be(new_ctx)
        instance.execution_context = new_ctx

        expect(instance.execution_context).to be(new_ctx)
        expect(instance.codec.execution_context).to be(new_ctx)
      end

      it 'emits a deprecation warning' do
        expect(deprecation_logger_stub).to receive(:deprecated) do |message|
          expect(message).to match(/execution_context=/)
        end

        instance.execution_context = execution_context
      end
    end
  end
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



logstash-core/spec/logstash/outputs/base_spec.rb [105:134]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    context 'execution_context=' do
      let(:deprecation_logger_stub) { double('DeprecationLogger').as_null_object }
      before(:each) do
        allow(klass).to receive(:deprecation_logger).and_return(deprecation_logger_stub)
      end

      it "allow to set the context" do
        new_ctx = execution_context.dup
        subject.execution_context = new_ctx
        expect(subject.execution_context).to be(new_ctx)
      end

      it "propagate the context to the codec" do
        new_ctx = execution_context.dup
        expect(instance.codec.execution_context).to_not be(new_ctx)
        instance.execution_context = new_ctx

        expect(instance.execution_context).to be(new_ctx)
        expect(instance.codec.execution_context).to be(new_ctx)
      end

      it 'emits a deprecation warning' do
        expect(deprecation_logger_stub).to receive(:deprecated) do |message|
          expect(message).to match(/execution_context=/)
        end

        instance.execution_context = execution_context
      end
    end
  end
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



