class Capsium::Package::Testing::TestSuite
Loads and runs the package’s tests/*.yaml suites (05x-testing). Route tests are served by a reactor on an ephemeral port for the duration of the run. Invalid test definitions are reported as failed results instead of aborting the run.
Constants
- BUILTIN_TEST_KINDS
-
Referencing the built-in test kinds triggers their autoload, which registers them in
TestCase.types(each kind file self-registers on load). - TESTS_DIR
Attributes
Public Class Methods
(Capsium::Package package) → void
Source
# File lib/capsium/package/testing/test_suite.rb, line 23 def initialize(package) @package = package end
Public Instance Methods
# File lib/capsium/package/testing/test_suite.rb, line 31 def run report = Report.new loaded = load_cases(report) with_reactor(loaded) do |base_url| context = Context.new(package_path: @package.path, base_url: base_url) loaded.each { |test_case| report << run_case(test_case, context) } end report end
() → Array[String]
Source
# File lib/capsium/package/testing/test_suite.rb, line 27 def test_files Dir.glob(File.join(@package.path, TESTS_DIR, "*.{yaml,yml}")) end