Skip to content

Commit

Permalink
Fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Mar 26, 2023
1 parent 04d2219 commit 46a3a09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sentry-ruby/spec/isolated/puma_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require "puma"
require_relative "../spec_helper"

# Because puma doesn't have any dependency, if Rack is not installed the entire test won't work
return if ENV["RACK_VERSION"] == "0"

RSpec.describe Puma::Server do
class TestServer
def initialize(app, options)
Expand Down Expand Up @@ -47,7 +50,7 @@ def server_run(app, lowlevel_error_handler: nil, &block)
events = sentry_events
expect(events.count).to eq(1)
event = events.first
expect(event.exception.values.first.value).to eq("foo (RuntimeError)")
expect(event.exception.values.first.value).to match("foo")
end

context "when user defines lowlevel_error_handler" do
Expand All @@ -69,7 +72,7 @@ def server_run(app, lowlevel_error_handler: nil, &block)
events = sentry_events
expect(events.count).to eq(1)
event = events.first
expect(event.exception.values.first.value).to eq("foo (RuntimeError)")
expect(event.exception.values.first.value).to match("foo")
end
end

Expand Down

0 comments on commit 46a3a09

Please sign in to comment.