Skip to content

Commit

Permalink
Fix undefined method for nil spec with ruby-head
Browse files Browse the repository at this point in the history
  • Loading branch information
bliof-fc committed Feb 27, 2024
1 parent 4a2fd1f commit e955e20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/integration/sinatra_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ class MySinatraApp < Sinatra::Base
it 'logs the request with the exception' do
get '/error', {}, 'HTTP_X_REQUEST_ID' => '700a6a01'

expect(last_log_entry).to start_with("E, #{time_pid_tags} GET /error 500 in 0ms type=request #{data_as_text} exception=undefined method `name' for nil")
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('3.4')
expect(last_log_entry).to start_with("E, #{time_pid_tags} GET /error 500 in 0ms type=request #{data_as_text} exception=undefined method 'name' for nil")
else
expect(last_log_entry).to start_with("E, #{time_pid_tags} GET /error 500 in 0ms type=request #{data_as_text} exception=undefined method `name' for nil")
end
end
end
end
Expand Down

0 comments on commit e955e20

Please sign in to comment.