Stats
Actions
Tags
From boxlang-agent-skills
Scaffold a JUnit 5 test for a BoxLang BIF. Usage: /boxlang-agent-skills:new-bif-test com.example.bifs.MyFunction
How this command is triggered — by the user, by Claude, or both
Slash command
/boxlang-agent-skills:new-bif-testThe summary Claude sees in its command listing — used to decide when to auto-load this command
Create a JUnit 5 test class for the BoxLang BIF `$ARGUMENTS`. ## Rules - Add the Apache 2.0 file header — read `workbench/CodeHeader.txt` from the BoxLang source root for the exact text - Mirror the BIF package under the test source root: `src/test/java/<package/path>/<ClassName>Test.java` - Use Google Truth for all assertions: `import static com.google.common.truth.Truth.assertThat` - Also import `static org.junit.Assert.assertTrue` for instanceof checks ## Standard class structure ## Required imports ## Test method pattern Each test must: - Be annotated with `@DisplayName( "It s...
Create a JUnit 5 test class for the BoxLang BIF $ARGUMENTS.
workbench/CodeHeader.txt from the BoxLang source root for the exact textsrc/test/java/<package/path>/<ClassName>Test.javaimport static com.google.common.truth.Truth.assertThatstatic org.junit.Assert.assertTrue for instanceof checksstatic BoxRuntime instance;
IBoxContext context;
IScope variables;
static Key result = new Key( "result" );
@BeforeAll
public static void setUp() {
instance = BoxRuntime.getInstance( true );
}
@AfterAll
public static void teardown() {
}
@BeforeEach
public void setupEach() {
context = new ScriptingRequestBoxContext( instance.getRuntimeContext() );
variables = context.getScopeNearby( VariablesScope.name );
}
import ortus.boxlang.runtime.BoxRuntime;
import ortus.boxlang.runtime.context.IBoxContext;
import ortus.boxlang.runtime.context.ScriptingRequestBoxContext;
import ortus.boxlang.runtime.scopes.IScope;
import ortus.boxlang.runtime.scopes.Key;
import ortus.boxlang.runtime.scopes.VariablesScope;
import org.junit.jupiter.api.*;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertTrue;
Each test must:
@DisplayName( "It should ..." ) and @Testinstance.executeSource( "...boxlang script...", context ) — store output in the result variablevariables.get( result ) or variables.getAsString( result ) etc.@BoxMember): call as value.methodName()assertThrowsnpx claudepluginhub ortus-boxlang/skills --plugin boxlang-agent-skills