Module: Magik::Testing

Defined in:
lib/magik/testing.rb

Overview

The test DSL, compiling to Minitest (never RSpec), with auto-inferred factories and a parallel runner.

Implements: Phase 9 — Testing of docs/idea/00-build-spec.md.

Planned DSL surface, copied from the spec:

  • test :Name do it "..." do expect(...) end end
  • helpers: perform_action, render_screen, concurrently(n), travel_to
  • helpers: assert_enqueued, assert_broadcast, assert_notified
  • parallel: one thread per test file group, workers: :auto, transactional rollback per test
  • magik test, magik test --watch, magik test --changed

A worker is a thread, and there is exactly one worker model. TruffleRuby's threads are genuinely parallel — that is why it is the production runtime — and it implements no fork, so there is no forked worker to fall back to (docs/architecture/12-runtime-verification.md).

Status: Not implemented — spec only. Every entry point below raises NotImplementedError. Nothing here reads config, touches a database or emits a byte of HTML.

See Also:

Constant Summary collapse

SPEC_PHASE =

The build-spec phase this subsystem implements.

Returns:

  • (String)
"Phase 9 — Testing"
DSL_SURFACE =

The DSL this subsystem will expose, verbatim from the spec.

Returns:

  • (Array<String>)
[
  "test :Name do it \"...\" do expect(...) end end",
  "helpers: perform_action, render_screen, concurrently(n), travel_to",
  "helpers: assert_enqueued, assert_broadcast, assert_notified",
  "parallel: one thread per test file group, workers: :auto, transactional rollback per test",
  "magik test, magik test --watch, magik test --changed"
].freeze
STATUS =

Implementation status of this subsystem.

Returns:

  • (String)
"Not implemented — spec only"

Class Method Summary collapse

Class Method Details

.define(*_args, **_options) ⇒ void

This method returns an undefined value.

Entry point for the Testing DSL.

Parameters:

  • _args (Array) —

    ignored

  • _options (Hash) —

    ignored

Raises:

  • (NotImplementedError) —

    always, until Phase 9 lands



52
53
54
# File 'lib/magik/testing.rb', line 52

def self.define(*_args, **_options)
  raise NotImplementedError, "Magik::Testing is spec-only; see docs/idea/00-build-spec.md"
end