Files
mesh-delivery/contracts/go/seats/nodebuildimage/acts_test.go
T

25 lines
676 B
Go

package nodebuildimage
import (
"encoding/json"
"os"
"testing"
)
// The seat's `build` acting rule matches an artifact by its kind, an image having no language (design 47 G §324, §397).
func TestTheSeatsBuildRuleActsOnTheKindImage(t *testing.T) {
raw, err := os.ReadFile("../../../seats/node-build-image/seat.json")
if err != nil {
t.Fatal(err)
}
var def struct {
Acts []struct{ Step, On, Bound string } `json:"acts"`
}
if err := json.Unmarshal(raw, &def); err != nil {
t.Fatal(err)
}
if len(def.Acts) != 1 || def.Acts[0].Step != "build" || def.Acts[0].On != "kind:image" {
t.Errorf("acts = %+v; wanted the one rule {build, kind:image}", def.Acts)
}
}