Skip to content

Commit

Permalink
Wrap reads with it do
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwkast committed Oct 23, 2024
1 parent eb19f98 commit 4197b1a
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions spec/datadog/tracing/contrib/rails/cache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@
Datadog.configuration.tracing[:active_support][:cache_key_enabled] = false
end

expect(read).to eq(50)
it do
expect(read).to eq(50)

expect(spans).to have(2).items
get, set = spans
expect(get.name).to eq('rails.cache')
expect(get.get_tag('rails.cache.key')).to be_nil
expect(spans).to have(2).items
get, set = spans
expect(get.name).to eq('rails.cache')
expect(get.get_tag('rails.cache.key')).to be_nil
end
end
end

Expand Down Expand Up @@ -168,11 +170,13 @@
Datadog.configuration.tracing[:active_support][:cache_key_enabled] = false
end

expect(read_multi).to eq(Hash[multi_keys.zip([51, 52, 53])])
expect(spans).to have(1 + multi_keys.size).items
get = spans[0]
expect(get.name).to eq('rails.cache')
expect(get.get_tag('rails.cache.keys')).to be_nil
it do
expect(read_multi).to eq(Hash[multi_keys.zip([51, 52, 53])])
expect(spans).to have(1 + multi_keys.size).items
get = spans[0]
expect(get.name).to eq('rails.cache')
expect(get.get_tag('rails.cache.keys')).to be_nil
end
end
end

Expand Down

0 comments on commit 4197b1a

Please sign in to comment.