module

Alumna::Testing

Class methods

build_ctx(app : App = App.new, service : Service = MemoryAdapter.new, path : String = "/test", method : ServiceMethod = ServiceMethod::Find, phase : RulePhase = RulePhase::Before, params : Hash(String, String) = {} of String => String, headers : Hash(String, String) = {} of String => String, http_method : String = "GET", remote_ip : String = "127.0.0.1", provider : String = "rest", id : String | Nil = nil, data : Hash(String, AnyData) = {} of String => AnyData) : RuleContext

Utility to quickly fabricate a RuleContext for testing purposes. Provides sensible defaults so you only need to override what you are testing.

Source
run_rule(rule : Rule, ctx : RuleContext | Nil = nil, **kwargs) : RuleRunnerResult

Executes a single Rule against a context and returns a result wrapper containing both the mutated context and the returned error (if any).

Source

Nested types