func TestGetInt(t *testing.T) { Convey("Given an instance", t, func() { instance := new(fargo.Instance) Convey("With metadata", func() { metadata := new(fargo.InstanceMetadata) instance.Metadata = *metadata Convey("That has a single integer value", func() { key := "d" value := 1 metadata.Raw = []byte("<" + key + ">" + strconv.Itoa(value) + "</" + key + ">") Convey("GetInt should return that value", func() { actualValue, err := metadata.GetInt(key) So(err, ShouldBeNil) So(actualValue, ShouldEqual, value) }) }) }) }) }