From iris-dev
Generates %UnitTest.TestCase subclasses for ObjectScript classes using live IRIS introspection. Use when asked to write tests for any ObjectScript class or method.
How this skill is triggered — by the user, by Claude, or both
Slash command
/iris-dev:objectscript-unit-testThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate idiomatic IRIS `%UnitTest.TestCase` test scaffolds grounded in live class introspection — not guessed from code. Each generated test compiles and runs against a real IRIS instance.
Generate idiomatic IRIS %UnitTest.TestCase test scaffolds grounded in live class introspection — not guessed from code. Each generated test compiles and runs against a real IRIS instance.
Tool: objectscript_iris_generate_test
Inputs: class_name (e.g. "MyApp.Utils"), method_name (optional, generates all if omitted), test_directory (default "tests")
Returns: test class code + suggested output path
The tool uses objectscript_docs_introspect to read the live class definition — method signatures, return types, class vs instance methods — and generates appropriate test scaffolds.
Each generated test method follows this pattern:
Method TestMyMethod()
{
// Arrange
Set tObj = ##class(MyApp.Utils).%New()
// Act
Set tResult = tObj.MyMethod()
// Assert
Do $$$AssertEquals(tResult, expectedValue, "MyMethod should return expected value")
}
For %Status-returning methods, assertions use $$$AssertStatusOK:
Do $$$AssertStatusOK(tSC, "MyMethod should succeed")
Tool: objectscript_iris_compile
Inputs: target (path to generated .cls file)
Tool: objectscript_iris_test
Inputs: pattern (e.g. "Test.MyApp.*")
Fix any compile errors, then confirm all generated tests pass before adding assertions.
The scaffold generates placeholder assertions. Replace them with meaningful expected values based on the method's documented behavior or known inputs/outputs.
| Element | Convention |
|---|---|
| Test class | Test.<OriginalPackage>.<ClassName> |
| Test method | Test<OriginalMethodName> |
| Output file | tests/Test/<Package>/<ClassName>.cls |
%New() + method call##class() call%Status returns: $$$AssertStatusOK assertion$$$AssertEquals placeholder assertion% or marked Private)✅ Generated test class
Test.MyApp.Utils—Ntest methods Output path:tests/Test/MyApp/Utils.clsNext: compile and run withobjectscript_iris_test("Test.MyApp.*")
npx claudepluginhub intersystems-community/iris-agentic-devCompile-test-fix loop for ObjectScript development. Guides writing, compiling, and testing ObjectScript classes with common error fixes.
Generate ABAP Unit tests for classes with dependency analysis, interface-based test doubles, and method-level surgical insertion.
Creates DUnitX unit tests for Delphi projects on explicit request or automatically after a new implementation class is written by delphi-writer. Supports TDD and test coverage.