diff --git a/spec/datadog/tracing/contrib/rails/runner_spec.rb b/spec/datadog/tracing/contrib/rails/runner_spec.rb index 388951ac72f..419a324e45f 100644 --- a/spec/datadog/tracing/contrib/rails/runner_spec.rb +++ b/spec/datadog/tracing/contrib/rails/runner_spec.rb @@ -136,6 +136,14 @@ expect(span.get_tag('operation')).to eq('runner.inline') end + context "when a current span isn't detected" do + it "skips setting the source tag" do + allow(Datadog::Tracing).to receive(:active_span).and_return(nil) + + expect { run }.to output('OK').to_stdout + end + end + include_context 'with a custom service name' include_context 'with source code too long'