summaryrefslogtreecommitdiff
path: root/test/spec_deflater.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-02-03 13:20:12 -0800
committerJeremy Evans <code@jeremyevans.net>2022-02-03 16:35:50 -0800
commit2833813bd7f2a1872831d83cc9a0bb60f7d94fdd (patch)
tree74c1cb61a6e6fe4810f24ba795744f1ec693719e /test/spec_deflater.rb
parent568dee5a2de80a9da20e2baf084b215abeee4ea8 (diff)
downloadrack-2833813bd7f2a1872831d83cc9a0bb60f7d94fdd.tar.gz
Enable directly requiring Rack components
Add test:separate task to test run each test file separately. This is to test that directly requiring a rack component will work. With test:separate, the test helper will not require rack, and each test file should call separate_testing with a block that uses require_relative to only require that component being tested. Add the appropriate relative requires to get all tests passing when run separately. Note that this isn't foolproof. In many cases, the tests use Rack components that are not under test (such as lint and mock), and both of those other other rack components, so it's possible the tests are loading hidden dependencies. I attempted to check each component to try to find the hidden dependencies, but it is certainly possible I missed something. Implements #1621.
Diffstat (limited to 'test/spec_deflater.rb')
-rw-r--r--test/spec_deflater.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/spec_deflater.rb b/test/spec_deflater.rb
index ed9cffec..2eb60bd9 100644
--- a/test/spec_deflater.rb
+++ b/test/spec_deflater.rb
@@ -4,6 +4,12 @@ require_relative 'helper'
require 'time' # for Time#httpdate
require 'zlib'
+separate_testing do
+ require_relative '../lib/rack/deflater'
+ require_relative '../lib/rack/lint'
+ require_relative '../lib/rack/mock'
+end
+
describe Rack::Deflater do
def build_response(status, body, accept_encoding, options = {})