Plugin Reference
Test Plugin
Klenod::Test::Plugin discovers test entrypoints and keeps them outside the application import graph.
Configuration
Add the plugin to the same development configuration as the application plugins:
Klenod::Test::Plugin.new(
pattern: "**/*.test.rb"
)
pattern is a source-relative glob. It defaults to **/*.test.rb.
Test Boundaries
Test files are independent entrypoints. They can import Ruby, Haml, CSS, data, assets, and other application modules through the normal plugin graph. Application modules and tests cannot import a file matched by the test pattern. Shared test helpers should therefore use ordinary .rb filenames.
Normal builds do not discover test entrypoints, so tests are absent from production bundles.
Selecting Related Tests
Klenod::Test::Suite discovers tests through the plugin and collects their complete static dependency closures without evaluating them:
suite = Klenod::Test::Suite.new(
context: context,
plugin: test_plugin
)
initial = suite.collect
related = suite.update(event)
Both results expose sorted test_paths and removed_test_paths. A framework decides how to evaluate those paths and which test library reports the results.
The klenod-test package combines these APIs with the Klenod watcher and fresh worker processes. The klenod meta-gem exposes them as klenod test and klenod coverage. Both delegate execution to callbacks from klenod.test.rb, so they do not depend on Minitest or another testing library.