Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions spec/datadog/di/component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@
context 'when dynamic instrumentation is enabled' do
let(:dynamic_instrumentation_enabled) { true }

before do
allow(agent_settings).to receive(:hostname)
allow(agent_settings).to receive(:port)
allow(agent_settings).to receive(:timeout_seconds).and_return(1)
allow(agent_settings).to receive(:ssl)
let(:agent_settings) do
instance_double_agent_settings_with_stubs
end

context 'when remote config is enabled' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,7 @@ def target_method
end

let(:agent_settings) do
instance_double_agent_settings.tap do |agent_settings|
allow(agent_settings).to receive(:hostname)
allow(agent_settings).to receive(:port)
allow(agent_settings).to receive(:timeout_seconds).and_return(1)
allow(agent_settings).to receive(:ssl)
end
instance_double_agent_settings_with_stubs
end

let(:stringified_probe_spec) do
Expand Down
9 changes: 4 additions & 5 deletions spec/datadog/di/integration/instrumentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,13 @@ def exception_method

context 'log probe' do
before do
allow(agent_settings).to receive(:hostname)
allow(agent_settings).to receive(:port)
allow(agent_settings).to receive(:timeout_seconds).and_return(1)
allow(agent_settings).to receive(:ssl)

allow(Datadog::DI).to receive(:current_component).and_return(component)
end

let(:agent_settings) do
instance_double_agent_settings_with_stubs
end

context 'method probe' do
context 'basic probe' do
let(:probe) do
Expand Down
7 changes: 7 additions & 0 deletions spec/datadog/di/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ def deep_stringify_keys(hash)
def instance_double_agent_settings
instance_double(Datadog::Core::Configuration::AgentSettings)
end

def instance_double_agent_settings_with_stubs
instance_double(
Datadog::Core::Configuration::AgentSettings,
hostname: "test-host", port: 9000, timeout_seconds: 1, ssl: false
)
end
end
end

Expand Down