moonrockz/moonspec/core does not have a README file
pub trait Attachable {
attach(Self, String, String, file_name? : String) -> Unit
attach_bytes(Self, Bytes, String, file_name? : String) -> Unit
attach_url(Self, String, String) -> Unit
pending_attachments(Self) -> Array[PendingAttachment]
}struct MyWorld { mut count : Int } derive(Default)
impl @moonspec.World for MyWorld with configure(self, s) {
s.given("a count of {int}", fn(ctx) {
match ctx[0] { { value: IntVal(n), .. } => self.count = n; _ => () }
})
}pub suberror MoonspecError {
UndefinedStep(String, String, String, Array[String])
PendingStep(String, String, String)
StepFailed(String, String, String)
ScenarioFailed(String, String, Array[MoonspecError])
RunFailed(String, Array[MoonspecError])
}pub(all) struct CaseHookCtx {
// private fields
}fn CaseHookCtx::attach(self : CaseHookCtx, body : String, media_type : String, file_name? : String) -> Unitfn CaseHookCtx::attach_bytes(self : CaseHookCtx, data : Bytes, media_type : String, file_name? : String) -> Unittype CompiledSteppub(all) struct Ctx {
// private fields
}pub(all) struct DocString {
content : String
media_type : String?
fn new(content~ : String, media_type? : String) -> DocString
}pub(all) enum HookError {
StepFailed(String, StepKeyword, String)
ScenarioFailed(String, String, String)
}pub(all) enum HookHandler {
RunHandler((RunHookCtx) -> Unit raise)
RunAfterHandler((RunHookCtx, HookResult) -> Unit raise)
CaseHandler((CaseHookCtx) -> Unit raise)
CaseAfterHandler((CaseHookCtx, HookResult) -> Unit raise)
StepHandler((StepHookCtx) -> Unit raise)
StepAfterHandler((StepHookCtx, HookResult) -> Unit raise)
}pub(all) struct HookRegistry {
// private fields
}fn HookRegistry::add(self : HookRegistry, type_ : HookType, handler : HookHandler, source? : StepSource?) -> Unitimpl Eq for HookResultimpl Show for HookResultpub(all) enum HookType {
BeforeTestRun
AfterTestRun
BeforeTestCase
AfterTestCase
BeforeTestStep
AfterTestStep
}pub(all) enum PendingAttachment {
Embedded(String, AttachmentContentEncoding, String, String?)
External(String, String)
}pub(all) struct RegisteredHook {
id : String
type_ : HookType
handler : HookHandler
source : StepSource?
}pub(all) struct RunHookCtx {
// private fields
}fn RunHookCtx::attach(self : RunHookCtx, body : String, media_type : String, file_name? : String) -> Unitfn RunHookCtx::attach_bytes(self : RunHookCtx, data : Bytes, media_type : String, file_name? : String) -> Unitimpl Eq for ScenarioInfoimpl Show for ScenarioInfopub(all) struct Setup {
// private fields
}fn Setup::add_param_type(self : Setup, name : String, patterns : Array[RegexPattern], transformer? : Transformer) -> Unitfn Setup::add_param_type_strings(self : Setup, name : String, patterns : Array[String], transformer? : Transformer) -> Unit#callsite(autofill(loc))
fn Setup::after_test_case(self : Setup, handler : (CaseHookCtx, HookResult) -> Unit raise, loc~ : SourceLoc) -> Unit#callsite(autofill(loc))
fn Setup::after_test_run(self : Setup, handler : (RunHookCtx, HookResult) -> Unit raise, loc~ : SourceLoc) -> Unit#callsite(autofill(loc))
fn Setup::after_test_step(self : Setup, handler : (StepHookCtx, HookResult) -> Unit raise, loc~ : SourceLoc) -> Unit#callsite(autofill(loc))
fn Setup::before_test_case(self : Setup, handler : (CaseHookCtx) -> Unit raise, loc~ : SourceLoc) -> Unit#callsite(autofill(loc))
fn Setup::before_test_run(self : Setup, handler : (RunHookCtx) -> Unit raise, loc~ : SourceLoc) -> Unit#callsite(autofill(loc))
fn Setup::before_test_step(self : Setup, handler : (StepHookCtx) -> Unit raise, loc~ : SourceLoc) -> Unitpub(all) struct StepDef {
keyword : StepKeyword
pattern : String
handler : StepHandler
source : StepSource?
id : StepDefId?
}#deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
fn StepHandler::inner(self : StepHandler) -> ((Ctx) -> Unit raise)pub(all) struct StepHookCtx {
// private fields
}fn StepHookCtx::attach(self : StepHookCtx, body : String, media_type : String, file_name? : String) -> Unitfn StepHookCtx::attach_bytes(self : StepHookCtx, data : Bytes, media_type : String, file_name? : String) -> Unitpub(all) struct StepInfo {
keyword : String
text : String
}pub(all) enum StepKeyword {
Given
When
Then
Step
}impl Eq for StepKeywordimpl Show for StepKeywordpub(all) struct StepRegistry {
// private fields
}fn StepRegistry::find_match(self : StepRegistry, text : String, keyword? : String) -> StepMatchResultfn StepRegistry::register_def(self : StepRegistry, step_def : StepDef, param_registry : ParamTypeRegistry) -> Unitfn[L : StepLibrary] StepRegistry::use_library(self : StepRegistry, library : L, param_registry : ParamTypeRegistry) -> Unitpub(all) struct StepSource {
uri : String?
line : Int?
}impl Eq for StepSourceimpl Show for StepSourcefn pending_step_error(step~ : String, keyword~ : String, message~ : String) -> Errorfn scenario_failed_error(scenario~ : String, feature~ : String, errors~ : Array[MoonspecError]) -> MoonspecErrorfn step_failed_error(step~ : String, keyword~ : String, message~ : String) -> ErrorInstall
Download zipBDD test framework for MoonBit with Gherkin and Cucumber Expressions