Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Jun 14, 2024
1 parent 5c9ee72 commit a22a49c
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions spec/datadog/tracing/span_operation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,20 @@
end
end

describe ':id' do
let(:options) { { id: id } }

context 'that is nil' do
let(:id) { nil }
it { is_expected.to have_attributes(id: kind_of(Integer)) }
end

context 'that is an Integer' do
let(:id) { instance_double(Integer) }
it { is_expected.to have_attributes(id: id) }
end
end

describe ':resource' do
it_behaves_like 'a string property' do
let(:property) { :resource }
Expand Down Expand Up @@ -319,24 +333,6 @@
end
end

describe '#id=' do
subject!(:id=) { span_op.id = id }

context 'with a valid 64 bit integer' do
let(:id) { 2 ^ 64 - 1 }
it { expect(span_op.id).to eq(id) }
end
end

describe '#trace_id=' do
subject!(:trace_id=) { span_op.trace_id = trace_id }

context 'with a valid 128 bit integer' do
let(:trace_id) { 2 ^ 128 - 1 }
it { expect(span_op.trace_id).to eq(trace_id) }
end
end

describe '#measure' do
subject(:measure) { span_op.measure(&block) }

Expand Down

0 comments on commit a22a49c

Please sign in to comment.