diff --git a/lib/datadog/appsec/contrib/sinatra/patcher.rb b/lib/datadog/appsec/contrib/sinatra/patcher.rb index 3811e2a7351..33345f30079 100644 --- a/lib/datadog/appsec/contrib/sinatra/patcher.rb +++ b/lib/datadog/appsec/contrib/sinatra/patcher.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../../tracing/contrib/rack/middlewares' +require_relative '../../../tracing/contrib' require_relative '../patcher' require_relative '../../response' diff --git a/lib/datadog/appsec/extensions.rb b/lib/datadog/appsec/extensions.rb index 40e4bc481e7..d524bea0731 100644 --- a/lib/datadog/appsec/extensions.rb +++ b/lib/datadog/appsec/extensions.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require_relative 'configuration' +require_relative '../core/configuration' module Datadog module AppSec diff --git a/spec/loading_spec.rb b/spec/loading_spec.rb new file mode 100644 index 00000000000..aaa46cd2d3a --- /dev/null +++ b/spec/loading_spec.rb @@ -0,0 +1,38 @@ +require 'shellwords' + +REQUIRES = { + 'datadog/appsec' => 'Datadog::AppSec', + 'datadog/core' => 'Datadog::Core', + 'datadog/kit' => 'Datadog::Kit', + 'datadog/profiling' => 'Datadog::Profiling', + 'datadog/tracing' => 'Datadog::Tracing', +}.freeze + +RSpec.describe 'loading of products' do + REQUIRES.each do |req, const| + context req do + let(:code) do + <<-E + if defined?(Datadog) + unless Datadog.constants == [:VERSION] + exit 1 + end + end + + require "#{req}" + + unless defined?(#{const}) + exit 1 + end + + exit 0 + E + end + + it 'loads successfully by itself' do + rv = system("ruby -e #{Shellwords.shellescape(code)}") + expect(rv).to be true + end + end + end +end