Skip to content

Commit 2746b24

Browse files
committed
Merge branch 'add-more-mount-serial-tests'
2 parents ea77338 + 0db0bc9 commit 2746b24

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

api/def/formulaAction_serial_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,22 @@ func TestMountGroupCodec(t *testing.T) {
5858
})
5959
})
6060
})
61+
62+
Convey("Given serial MountGroup fixtures", t, func() {
63+
Convey("Decoding present but blank mounts into full formula should work", func() {
64+
fixture := `{"action":{"escapes":{"mounts":{}}}}`
65+
var reheat *def.Formula
66+
decodeFromJson([]byte(fixture), &reheat)
67+
So(len(reheat.Action.Escapes.Mounts), ShouldEqual, 0)
68+
})
69+
Convey("Decoding mounts into full formula should work", func() {
70+
fixture := `{"action":{"escapes":{"mounts":{"target":"source"}}}}`
71+
var reheat *def.Formula
72+
decodeFromJson([]byte(fixture), &reheat)
73+
mounts := reheat.Action.Escapes.Mounts
74+
So(mounts, ShouldHaveLength, 1)
75+
So(mounts[0].TargetPath, ShouldEqual, "target")
76+
So(mounts[0].SourcePath, ShouldEqual, "source")
77+
})
78+
})
6179
}

0 commit comments

Comments
 (0)