Skip to content

Commit 98355b1

Browse files
committed
Fix specs after rebase
1 parent d7522f9 commit 98355b1

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

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

+8-8
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117

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

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

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

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

sentry-ruby/lib/sentry/rspec.rb

+1-1
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/spec/sentry/event_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
it "doesn't overwrite already set ip address" do
147147
Sentry.set_user({ ip_address: "3.3.3.3" })
148148
Sentry.get_current_scope.apply_to_event(event)
149-
expect(event.to_hash[:user][:ip_address]).to eq("3.3.3.3")
149+
expect(event.to_h[:user][:ip_address]).to eq("3.3.3.3")
150150
end
151151

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

sentry-ruby/spec/sentry/profiler_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
end
182182

183183
it 'returns empty' do
184-
expect(subject.to_hash).to eq({})
184+
expect(subject.to_h).to eq({})
185185
end
186186

187187
it 'records lost event' do

0 commit comments

Comments
 (0)