Skip to content

Commit

Permalink
Do not require logger in common_logger spec
Browse files Browse the repository at this point in the history
logger is moving from stdlib to bundled gems in Ruby 3.5, and will
be warning in Ruby 3.4.  This is the only code in Roda that requires
logger, and it's not necessary.
  • Loading branch information
jeremyevans committed Jun 7, 2024
1 parent 8744302 commit 4e64e6c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/plugin/common_logger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
require_relative "../spec_helper"

require 'logger'

describe "common_logger plugin" do
def cl_app(&block)
app(:common_logger, &block)
Expand All @@ -28,7 +26,10 @@ def cl_app(&block)
@logger.rewind
@logger.read.must_match(/\A1\.1\.1\.2 - - \[\d\d\/[A-Z][a-z]{2}\/\d\d\d\d:\d\d:\d\d:\d\d [-+]\d\d\d\d\] "GET \/a\/b\?foo=bar HTTP\/1.0" 200 2 0.\d\d\d\d\n\z/)

@app.plugin :common_logger, Logger.new(@logger)
logger = Struct.new(:logger) do
def <<(m) logger << m; end
end.new(@logger)
@app.plugin :common_logger, logger
@logger.rewind
@logger.truncate(0)
body("HTTP_VERSION"=>'HTTP/1.0').must_equal '/'
Expand Down

0 comments on commit 4e64e6c

Please sign in to comment.