Skip to content

Commit 8bc301e

Browse files
committed
Fix specs after rebase
1 parent 710a2f9 commit 8bc301e

File tree

15 files changed

+44
-44
lines changed

15 files changed

+44
-44
lines changed

sentry-rails/spec/sentry/rails/tracing/active_storage_subscriber_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
p = Post.create!
6969
get "/posts/#{p.id}/attach"
7070

71-
request_transaction = transport.events.last.to_hash
71+
request_transaction = transport.events.last.to_h
7272
expect(request_transaction[:type]).to eq("transaction")
7373
expect(request_transaction[:spans].count).to eq(2)
7474

sentry-rails/spec/sentry/rails/tracing/active_support_subscriber_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
transaction.finish
2424

2525
expect(transport.events.count).to eq(1)
26-
cache_transaction = transport.events.first.to_hash
26+
cache_transaction = transport.events.first.to_h
2727
expect(cache_transaction[:type]).to eq("transaction")
2828

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

4646
expect(Rails.cache.read("my_cache_key")).to eq(1)
4747
expect(transport.events.count).to eq(1)
48-
cache_transaction = transport.events.first.to_hash
48+
cache_transaction = transport.events.first.to_h
4949
expect(cache_transaction[:type]).to eq("transaction")
5050
expect(cache_transaction[:spans].count).to eq(1)
5151
expect(cache_transaction[:spans][0][:op]).to eq("cache.put")
@@ -64,7 +64,7 @@
6464
transaction.finish
6565

6666
expect(transport.events.count).to eq(1)
67-
cache_transaction = transport.events.first.to_hash
67+
cache_transaction = transport.events.first.to_h
6868
expect(cache_transaction[:type]).to eq("transaction")
6969
expect(cache_transaction[:spans].count).to eq(1)
7070
expect(cache_transaction[:spans][0][:op]).to eq("cache.put")
@@ -79,7 +79,7 @@
7979
transaction.finish
8080

8181
expect(transport.events.count).to eq(1)
82-
cache_transaction = transport.events.first.to_hash
82+
cache_transaction = transport.events.first.to_h
8383
expect(cache_transaction[:type]).to eq("transaction")
8484
expect(cache_transaction[:spans].count).to eq(1)
8585
expect(cache_transaction[:spans][0][:op]).to eq("cache.get")
@@ -95,7 +95,7 @@
9595
transaction.finish
9696

9797
expect(transport.events.count).to eq(1)
98-
cache_transaction = transport.events.first.to_hash
98+
cache_transaction = transport.events.first.to_h
9999
expect(cache_transaction[:type]).to eq("transaction")
100100
expect(cache_transaction[:spans].count).to eq(1)
101101
expect(cache_transaction[:spans][0][:op]).to eq("cache.get")
@@ -112,7 +112,7 @@
112112
transaction.finish
113113

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

131131
transaction.finish
132132
expect(transport.events.count).to eq(1)
133-
cache_transaction = transport.events.first.to_hash
133+
cache_transaction = transport.events.first.to_h
134134
expect(cache_transaction[:type]).to eq("transaction")
135135
expect(cache_transaction[:spans].count).to eq(2)
136136
expect(cache_transaction[:spans][0][:op]).to eq("cache.get")
@@ -152,7 +152,7 @@
152152

153153
transaction.finish
154154
expect(transport.events.count).to eq(1)
155-
cache_transaction = transport.events.first.to_hash
155+
cache_transaction = transport.events.first.to_h
156156
expect(cache_transaction[:type]).to eq("transaction")
157157
expect(cache_transaction[:spans].count).to eq(1)
158158
expect(cache_transaction[:spans][0][:op]).to eq("cache.remove")

sentry-rails/spec/sentry/rails/tracing_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123

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

128128
params = transaction[:spans][0][:data][:params]
129129
expect(params["foo"]).to eq("bar")
@@ -145,7 +145,7 @@
145145

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

150150
params = transaction[:spans][0][:data][:params]
151151
expect(params["foo"]).to eq("bar")

sentry-resque/spec/sentry/resque_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def self.perform(msg)
222222
process_job(worker)
223223
end.not_to raise_error(TypeError)
224224

225-
event = transport.events.last.to_hash
225+
event = transport.events.last.to_h
226226
expect(event.dig(:exception, :values, 0, :type)).to eq("ZeroDivisionError")
227227
end
228228
end

sentry-ruby/lib/sentry/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ def send_logs(log_events)
287287
processed_log_event = configuration.before_send_log.call(log_event)
288288

289289
if processed_log_event
290-
envelope_items << processed_log_event.to_hash
290+
envelope_items << processed_log_event.to_h
291291
else
292292
discarded_count += 1
293293
end
294294
end
295295

296296
envelope_items
297297
else
298-
envelope_items = log_events.map(&:to_hash)
298+
envelope_items = log_events.map(&:to_h)
299299
end
300300

301301
envelope.add_item(

sentry-ruby/lib/sentry/log_event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def initialize(configuration: Sentry.configuration, **options)
8787
@contexts = {}
8888
end
8989

90-
def to_hash
90+
def to_h
9191
SERIALIZEABLE_ATTRIBUTES.each_with_object({}) do |name, memo|
9292
memo[name] = serialize(name)
9393
end

sentry-ruby/lib/sentry/rspec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def find_matched_event(event_message, sentry_events)
7070
end
7171

7272
def dump_events(sentry_events)
73-
sentry_events.map(&Kernel.method(:Hash)).map do |hash|
73+
sentry_events.map(&:to_h).map do |hash|
7474
hash.select { |k, _| [:message, :contexts, :tags, :exception].include?(k) }
7575
end.map do |hash|
7676
JSON.pretty_generate(hash)

sentry-ruby/lib/sentry/vernier/profiler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def active_thread_id
9090
Thread.current.object_id
9191
end
9292

93-
def to_hash
93+
def to_h
9494
unless @sampled
9595
record_lost_event(:sample_rate)
9696
return EMPTY_RESULT

sentry-ruby/spec/sentry/breadcrumb_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
end
108108

109109
it "rescues data serialization issue for extremely nested data and ditch the data" do
110-
result = very_deep_crumb.to_hash
110+
result = very_deep_crumb.to_h
111111

112112
expect(result[:category]).to eq("cow")
113113
expect(result[:message]).to eq("I cause too much recursion")

sentry-ruby/spec/sentry/event_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
it "doesn't overwrite already set ip address" do
145145
Sentry.set_user({ ip_address: "3.3.3.3" })
146146
Sentry.get_current_scope.apply_to_event(event)
147-
expect(event.to_hash[:user][:ip_address]).to eq("3.3.3.3")
147+
expect(event.to_h[:user][:ip_address]).to eq("3.3.3.3")
148148
end
149149

150150
context "with config.trusted_proxies = [\"2.2.2.2\"]" do

0 commit comments

Comments
 (0)