Skip to main content

RagdollTestUtils

Shared helpers for the ragdoll specs. Rigging is asserted against the local R6 rig from RigBuilderUtils.createR6BaseRig -- the R15 builders need InsertService, which headless test places cannot reach. Suppression/restore assertions poll: motor suppression settles a couple of task resumptions after the Ragdoll bind (velocity-recording promise, then the rigging subscriptions).

Functions

waitFor

RagdollTestUtils.waitFor(
condition() → boolean,
timeoutnumber?
) → boolean

Polls until the condition passes or the timeout elapses. Returns the final condition result so specs can expect(...).toBe(true) on it.

areMotorsEnabled

RagdollTestUtils.areMotorsEnabled(
characterModel,
enabledboolean
) → boolean

Returns whether every R6 ragdoll motor in the character matches the given Enabled state.

countBallSockets

RagdollTestUtils.countBallSockets(characterModel) → number

Counts the RagdollBallSocket constraints in the character.

awaitUnbound

RagdollTestUtils.awaitUnbound(
binderBinder,
instInstance
) → ()

Returns once inst is no longer bound. Removal is usually already done by the time we check; the guarded wait also covers a deferred case.

Show raw api
{
    "functions": [
        {
            "name": "waitFor",
            "desc": "Polls until the condition passes or the timeout elapses. Returns the final condition result so\nspecs can `expect(...).toBe(true)` on it.",
            "params": [
                {
                    "name": "condition",
                    "desc": "",
                    "lua_type": "() -> boolean"
                },
                {
                    "name": "timeout",
                    "desc": "",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 37,
                "path": "src/ragdoll/src/Shared/RagdollTestUtils.lua"
            }
        },
        {
            "name": "areMotorsEnabled",
            "desc": "Returns whether every R6 ragdoll motor in the character matches the given Enabled state.",
            "params": [
                {
                    "name": "character",
                    "desc": "",
                    "lua_type": "Model"
                },
                {
                    "name": "enabled",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 55,
                "path": "src/ragdoll/src/Shared/RagdollTestUtils.lua"
            }
        },
        {
            "name": "countBallSockets",
            "desc": "Counts the RagdollBallSocket constraints in the character.",
            "params": [
                {
                    "name": "character",
                    "desc": "",
                    "lua_type": "Model"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 81,
                "path": "src/ragdoll/src/Shared/RagdollTestUtils.lua"
            }
        },
        {
            "name": "awaitUnbound",
            "desc": "Returns once `inst` is no longer bound. Removal is usually already done by the time we check;\nthe guarded wait also covers a deferred case.",
            "params": [
                {
                    "name": "binder",
                    "desc": "",
                    "lua_type": "Binder"
                },
                {
                    "name": "inst",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 99,
                "path": "src/ragdoll/src/Shared/RagdollTestUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "RagdollTestUtils",
    "desc": "Shared helpers for the ragdoll specs. Rigging is asserted against the local R6 rig from\n[RigBuilderUtils.createR6BaseRig] -- the R15 builders need InsertService, which headless test\nplaces cannot reach. Suppression/restore assertions poll: motor suppression settles a couple of\ntask resumptions after the Ragdoll bind (velocity-recording promise, then the rigging\nsubscriptions).",
    "source": {
        "line": 11,
        "path": "src/ragdoll/src/Shared/RagdollTestUtils.lua"
    }
}