5 Commits

Author SHA1 Message Date
syeopite
c012206f80
Improve cache size check to be more performant
Summing the sizes of each cached file every time is very inefficient.
Instead we can simply store the cache size in an constant and increase
it everytime a file is added into the cache.
2025-06-03 17:10:10 -07:00
syeopite
52865ff0a2
Refactor logic for updating temp files in tests 2025-06-03 17:07:51 -07:00
syeopite
dc198546a0
Fix Ameba Lint/UselessAssign 2025-06-03 16:40:35 -07:00
syeopite
7226a72824
Isolate static assets handler spec from others
Running `crystal spec` without a file argument essentially produces one
big program that combines every single spec file, their imports, and
the files that those imports themselves depend on. Most of the types
within this combined program will get ignored by the compiler due to a
lack of any calls to them from the spec files.

But for some types, partially the HTTP module ones, using them within
the spec files will suddenly make the compiler enable a bunch of
previously ignored code. And those code will suddenly require the
presence of additional types, constants, etc. This not only make it
annoying for getting the specs working but also makes it difficult to
isolate behaviors for testing.

The `static_assets_handler_spec.cr` causes this issue and so will be
marked as an isolated spec for now. In the future all of the tests
should be organized into independent groupings similar to how the
Crystal compiler splits their tests into std, compiler, primitives and
interpreter.
2025-06-03 16:39:59 -07:00
syeopite
6c927c89a6
Add specs for the new StaticAssetsHandler 2025-06-03 16:35:40 -07:00