瀏覽代碼

Adds test for ensure tags can marshal/unmarshal string -> string

Dwayne Forde 7 年之前
父節點
當前提交
a91623ab44
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      types_test.go

+ 9 - 0
types_test.go

@@ -20,6 +20,15 @@ var _ = Describe("Source", func() {
 		Expect(source.Tag).To(Equal(resource.Tag("0")))
 	})
 
+	It("should unmarshal tag string value into a string", func() {
+		var source resource.Source
+		raw := []byte(`{ "tag": "foo" }`)
+
+		err := json.Unmarshal(raw, &source)
+		Expect(err).ToNot(HaveOccurred())
+		Expect(source.Tag).To(Equal(resource.Tag("foo")))
+	})
+
 	It("should unmarshal tag '' value to latest", func() {
 		var source resource.Source
 		raw := []byte(`{ "tag": "" }`)