MemoryBudget::SpecExpectations
Adds the same policy enforcement used by the CI command to Crystal specs.
Instance methods
within_allocation_budget(scenario_name : String, *, calls : Int, bytes : Int, warm_up_runs : Int32 = 0, &) : MemoryBudgetVerdict
Preserves the proven allocation helper while using the common checker.
within_allocation_budget_per_item(scenario_name : String, *, list_of_item_counts : Enumerable(Int32), fixed_calls : Int, calls_per_item : Int, fixed_bytes : Int, bytes_per_item : Int, & : Int32 -> ) : Nil
Checks declared input sizes against checked fixed-plus-per-item limits.
within_memory_budget(policy : ScenarioMemoryPolicy, &) : MemoryBudgetVerdict
Measures a block under a named typed policy and fails the current example on any invalid verdict.