Ver código fonte

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

Dwayne Forde 7 anos atrás
pai
commit
a91623ab44
1 arquivos alterados com 9 adições e 0 exclusões
  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": "" }`)