diff options
author | Jeremy Evans <code@jeremyevans.net> | 2022-02-03 13:20:12 -0800 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2022-02-03 16:35:50 -0800 |
commit | 2833813bd7f2a1872831d83cc9a0bb60f7d94fdd (patch) | |
tree | 74c1cb61a6e6fe4810f24ba795744f1ec693719e /test/spec_head.rb | |
parent | 568dee5a2de80a9da20e2baf084b215abeee4ea8 (diff) | |
download | rack-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_head.rb')
-rw-r--r-- | test/spec_head.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/spec_head.rb b/test/spec_head.rb index d2dedd28..0f0eb0c3 100644 --- a/test/spec_head.rb +++ b/test/spec_head.rb @@ -2,6 +2,12 @@ require_relative 'helper' +separate_testing do + require_relative '../lib/rack/head' + require_relative '../lib/rack/lint' + require_relative '../lib/rack/mock' +end + describe Rack::Head do def test_response(headers = {}) |