Checking error strings makes these tests flaky, especially if the
error string is changed in libcni. Have gone ahead an introduced a new
error type `NoConfigsFoundError` and the Match is against the error
type making it more deterministic.
It("returns a useful error", func() {
_, err := libcni.LoadConf(configDir, "some-plugin")
- Expect(err).To(MatchError("no net configurations found"))
+ Expect(err).To(MatchError(libcni.NoConfigsFoundError{Dir: configDir}))
})
})
It("returns a useful error", func() {
_, err := libcni.LoadConfList(configDir, "some-plugin")
- Expect(err).To(MatchError("no net configurations found"))
+ Expect(err).To(MatchError(libcni.NoConfigsFoundError{Dir: configDir}))
})
})