Skip to content

Commit

Permalink
Fix specs after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py committed Oct 31, 2024
1 parent d7522f9 commit 98355b1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
transaction.finish

expect(transport.events.count).to eq(1)
cache_transaction = transport.events.first.to_hash
cache_transaction = transport.events.first.to_h
expect(cache_transaction[:type]).to eq("transaction")

expect(cache_transaction[:spans].count).to eq(1)
Expand All @@ -45,7 +45,7 @@

expect(Rails.cache.read("my_cache_key")).to eq(1)
expect(transport.events.count).to eq(1)
cache_transaction = transport.events.first.to_hash
cache_transaction = transport.events.first.to_h
expect(cache_transaction[:type]).to eq("transaction")
expect(cache_transaction[:spans].count).to eq(1)
expect(cache_transaction[:spans][0][:op]).to eq("cache.put")
Expand All @@ -64,7 +64,7 @@
transaction.finish

expect(transport.events.count).to eq(1)
cache_transaction = transport.events.first.to_hash
cache_transaction = transport.events.first.to_h
expect(cache_transaction[:type]).to eq("transaction")
expect(cache_transaction[:spans].count).to eq(1)
expect(cache_transaction[:spans][0][:op]).to eq("cache.put")
Expand All @@ -79,7 +79,7 @@
transaction.finish

expect(transport.events.count).to eq(1)
cache_transaction = transport.events.first.to_hash
cache_transaction = transport.events.first.to_h
expect(cache_transaction[:type]).to eq("transaction")
expect(cache_transaction[:spans].count).to eq(1)
expect(cache_transaction[:spans][0][:op]).to eq("cache.get")
Expand All @@ -95,7 +95,7 @@
transaction.finish

expect(transport.events.count).to eq(1)
cache_transaction = transport.events.first.to_hash
cache_transaction = transport.events.first.to_h
expect(cache_transaction[:type]).to eq("transaction")
expect(cache_transaction[:spans].count).to eq(1)
expect(cache_transaction[:spans][0][:op]).to eq("cache.get")
Expand All @@ -112,7 +112,7 @@
transaction.finish

expect(transport.events.count).to eq(1)
cache_transaction = transport.events.first.to_hash
cache_transaction = transport.events.first.to_h
expect(cache_transaction[:type]).to eq("transaction")
expect(cache_transaction[:spans].count).to eq(2)
expect(cache_transaction[:spans][1][:op]).to eq("cache.flush")
Expand All @@ -130,7 +130,7 @@

transaction.finish
expect(transport.events.count).to eq(1)
cache_transaction = transport.events.first.to_hash
cache_transaction = transport.events.first.to_h
expect(cache_transaction[:type]).to eq("transaction")
expect(cache_transaction[:spans].count).to eq(2)
expect(cache_transaction[:spans][0][:op]).to eq("cache.get")
Expand All @@ -152,7 +152,7 @@

transaction.finish
expect(transport.events.count).to eq(1)
cache_transaction = transport.events.first.to_hash
cache_transaction = transport.events.first.to_h
expect(cache_transaction[:type]).to eq("transaction")
expect(cache_transaction[:spans].count).to eq(1)
expect(cache_transaction[:spans][0][:op]).to eq("cache.remove")
Expand Down
4 changes: 2 additions & 2 deletions sentry-rails/spec/sentry/rails/tracing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

it "does not record sensitive params" do
get "/posts?foo=bar&password=42&secret=baz"
transaction = transport.events.last.to_hash
transaction = transport.events.last.to_h

params = transaction[:spans][0][:data][:params]
expect(params["foo"]).to eq("bar")
Expand All @@ -139,7 +139,7 @@

it "records all params" do
get "/posts?foo=bar&password=42&secret=baz"
transaction = transport.events.last.to_hash
transaction = transport.events.last.to_h

params = transaction[:spans][0][:data][:params]
expect(params["foo"]).to eq("bar")
Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/lib/sentry/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def find_matched_event(event_message, sentry_events)
end

def dump_events(sentry_events)
sentry_events.map(&Kernel.method(:Hash)).map do |hash|
sentry_events.map(&:to_h).map do |hash|
hash.select { |k, _| [:message, :contexts, :tags, :exception].include?(k) }
end.map do |hash|
JSON.pretty_generate(hash)
Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/spec/sentry/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
it "doesn't overwrite already set ip address" do
Sentry.set_user({ ip_address: "3.3.3.3" })
Sentry.get_current_scope.apply_to_event(event)
expect(event.to_hash[:user][:ip_address]).to eq("3.3.3.3")
expect(event.to_h[:user][:ip_address]).to eq("3.3.3.3")
end

context "with config.trusted_proxies = [\"2.2.2.2\"]" do
Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/spec/sentry/profiler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
end

it 'returns empty' do
expect(subject.to_hash).to eq({})
expect(subject.to_h).to eq({})
end

it 'records lost event' do
Expand Down

0 comments on commit 98355b1

Please sign in to comment.