-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP add first part of shoryuken tracer spec
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'spec_helper' | ||
require 'spec/ddtrace/contrib/shoryuken/shoryuken_spec_helper' | ||
|
||
RSpec.describe Datadog::Contrib::Shoryuken::Tracer do | ||
let(:worker) { TestWorker.perform_async(body) } | ||
let(:tracer) { ::Datadog::Tracer.new(writer: writer) } | ||
let(:writer) { FauxWriter.new } | ||
let(:sqs_queue) { double Shoryuken::Queue, visibility_timeout: 60 } | ||
let(:queue) { 'default' } | ||
let(:body) { 'test' } | ||
let :sqs_msg do | ||
double \ | ||
Shoryuken::Message, | ||
queue_url: queue, | ||
body: 'test', | ||
attributes: { | ||
id: 1, | ||
test_attribute: 'test' | ||
} | ||
end | ||
|
||
before do | ||
allow(Shoryuken::Client).to receive(:queues).with(queue).and_return sqs_queue | ||
|
||
Shoryuken.server_middleware do |chain| | ||
chain.add Datadog::Contrib::Shoryuken::Tracer, tracer: tracer | ||
end | ||
end | ||
end |