diff --git a/spec/datadog/di/integration/everything_from_remote_config_spec.rb b/spec/datadog/di/integration/everything_from_remote_config_spec.rb index 928827e7c95..9f5afafab2f 100644 --- a/spec/datadog/di/integration/everything_from_remote_config_spec.rb +++ b/spec/datadog/di/integration/everything_from_remote_config_spec.rb @@ -373,16 +373,21 @@ def assert_received_and_errored context 'line probe received targeting loaded code not in code tracker' do let(:probe_spec) do {id: '11', name: 'bar', type: 'LOG_PROBE', where: { - sourceFile: 'instrumentation_integration_test_class.rb', lines: [22]}} + sourceFile: 'instrumentation_integration_test_class.rb', lines: [22] + }} end before do - Object.send(:remove_const, :InstrumentationIntegrationTestClass) rescue nil + begin + Object.send(:remove_const, :InstrumentationIntegrationTestClass) + rescue + nil + end # Files loaded via 'load' do not get added to $LOADED_FEATURES, # use 'require'. # Note that the other tests use 'load' because they want the # code to always be loaded. - require_relative 'instrumentation_integration_test_class.rb' + require_relative 'instrumentation_integration_test_class' expect($LOADED_FEATURES.detect do |path| File.basename(path) == 'instrumentation_integration_test_class.rb' end).to be_truthy @@ -396,8 +401,7 @@ def assert_received_and_errored it 'instruments code and adds probe to installed list' do expect_lazy_log_many(logger, :debug, /received probe from RC:/, - /error processing probe configuration:.*File matching probe path.*was loaded and is not in code tracker registry/, - ) + /error processing probe configuration:.*File matching probe path.*was loaded and is not in code tracker registry/,) do_rc(expect_hook: false) assert_received_and_errored