Commit e2ea6740 authored by Martín Ferrari's avatar Martín Ferrari

Patch test to avoid depending on a new version of go-convey.

parent cd2359fa
Description: Avoid requiring a new go-convey version with a workaround.
--- a/mysqld_exporter_test.go
+++ b/mysqld_exporter_test.go
@@ -104,19 +104,19 @@
})
convey.Convey("Missed user", func() {
_, err := parseMycnf([]byte(badConfig))
- convey.So(err, convey.ShouldBeError, fmt.Errorf("no user or password specified under [client] in %s", badConfig))
+ convey.So(err.Error(), convey.ShouldEqual, fmt.Errorf("no user or password specified under [client] in %s", badConfig).Error())
})
convey.Convey("Missed password", func() {
_, err := parseMycnf([]byte(badConfig2))
- convey.So(err, convey.ShouldBeError, fmt.Errorf("no user or password specified under [client] in %s", badConfig2))
+ convey.So(err.Error(), convey.ShouldEqual, fmt.Errorf("no user or password specified under [client] in %s", badConfig2).Error())
})
convey.Convey("No [client] section", func() {
_, err := parseMycnf([]byte(badConfig3))
- convey.So(err, convey.ShouldBeError, fmt.Errorf("no user or password specified under [client] in %s", badConfig3))
+ convey.So(err.Error(), convey.ShouldEqual, fmt.Errorf("no user or password specified under [client] in %s", badConfig3).Error())
})
convey.Convey("Invalid config", func() {
_, err := parseMycnf([]byte(badConfig4))
- convey.So(err, convey.ShouldBeError, fmt.Errorf("failed reading ini file: unclosed section: %s", badConfig4))
+ convey.So(err.Error(), convey.ShouldEqual, fmt.Errorf("failed reading ini file: unclosed section: %s", badConfig4).Error())
})
})
}
01-Avoid_new_dependency.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment