Sha256: d8a20089b30e43bb74f27efedca7bd0b2a4f6e02358e154453976e0d10897782

Contents?: true

Size: 1.07 KB

Versions: 20

Compression:

Stored size: 1.07 KB

Contents

if DependencyHelper.grape_present?
  require "appsignal/integrations/grape"

  context "Appsignal::Grape::Middleware constant" do
    let(:err_stream) { std_stream }
    let(:stderr) { err_stream.read }

    it "returns the Rack::GrapeMiddleware constant calling the Grape::Middleware constant" do
      silence { expect(Appsignal::Grape::Middleware).to be(Appsignal::Rack::GrapeMiddleware) }
    end

    it "prints a deprecation warning to STDERR" do
      capture_std_streams(std_stream, err_stream) do
        expect(Appsignal::Grape::Middleware).to be(Appsignal::Rack::GrapeMiddleware)
      end

      expect(stderr).to include(
        "appsignal WARNING: The constant Appsignal::Grape::Middleware has been deprecated."
      )
    end

    it "logs a warning" do
      logs =
        capture_logs do
          silence do
            expect(Appsignal::Grape::Middleware).to be(Appsignal::Rack::GrapeMiddleware)
          end
        end

      expect(logs).to contains_log(
        :warn,
        "The constant Appsignal::Grape::Middleware has been deprecated."
      )
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
appsignal-3.13.1-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.13.1 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.13.1.alpha.1-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.13.1.alpha.1 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.13.0-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.13.0 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.6-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.6 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.5-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.5 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.4-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.4 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.3-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.3 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.2-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.2 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.1-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.1 spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.0-java spec/lib/appsignal/integrations/grape_spec.rb
appsignal-3.12.0 spec/lib/appsignal/integrations/grape_spec.rb