Use references in D&D spell extraction
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
)
|
||||
|
||||
@@ -36,6 +37,18 @@ func TestModuleSpec(t *testing.T) {
|
||||
Provides: []string{
|
||||
"dnd.spell_casts",
|
||||
},
|
||||
ReferenceSlots: []contracts.ReferenceSlot{
|
||||
{
|
||||
Name: "glossary",
|
||||
Description: "Optional campaign glossary reference material used only for disambiguation.",
|
||||
AcceptedMediaTypes: []string{"text/plain; charset=utf-8"},
|
||||
},
|
||||
{
|
||||
Name: "roster",
|
||||
Description: "Optional campaign roster or player-character reference material used only for disambiguation.",
|
||||
AcceptedMediaTypes: []string{"text/plain; charset=utf-8"},
|
||||
},
|
||||
},
|
||||
}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("ModuleSpec() = %#v, want %#v", got, want)
|
||||
@@ -43,6 +56,7 @@ func TestModuleSpec(t *testing.T) {
|
||||
|
||||
got.Requires[0] = "changed"
|
||||
got.Provides[0] = "changed"
|
||||
got.ReferenceSlots[0].AcceptedMediaTypes[0] = "changed"
|
||||
again := ModuleSpec()
|
||||
if !reflect.DeepEqual(again, want) {
|
||||
t.Fatalf("ModuleSpec() after caller mutation = %#v, want %#v", again, want)
|
||||
|
||||
Reference in New Issue
Block a user