grim/convey

Fix unit test breakage

2017-05-08, Gary Kramlich
0426a925c8fa
Fix unit test breakage
--- a/bitbucket/types.go Mon May 08 19:44:05 2017 -0500
+++ b/bitbucket/types.go Mon May 08 19:57:08 2017 -0500
@@ -46,16 +46,33 @@
Services map[string]service `yaml:"services"`
}
+type clone struct {
+ Depth int `yaml:"depth"`
+}
+
type bitbucketPipelines struct {
Image string `yaml:"image"`
- Clone int `yaml:"clone"`
+ Clone clone `yaml:"clone"`
Pipelines pipelines `yaml:"pipelines"`
Definitions definition `yaml:"definitions"`
}
+func (c *clone) UnmarshalYAML(unmarshal func(interface{}) error) error {
+ type rawClone clone
+ raw := rawClone{Depth: 50}
+
+ if err := unmarshal(&raw); err != nil {
+ return err
+ }
+
+ *c = clone(raw)
+
+ return nil
+}
+
func (b *bitbucketPipelines) UnmarshalYAML(unmarshal func(interface{}) error) error {
type rawBitbucketPipelines bitbucketPipelines
- raw := rawBitbucketPipelines{Clone: 50}
+ raw := rawBitbucketPipelines{Clone: clone{}}
if err := unmarshal(&raw); err != nil {
return err