fix TestNoOrInexistentConfigShouldNotFail

This commit is contained in:
Martin 2016-05-24 14:23:42 +02:00
parent 629be45c4a
commit 1e27c2dabe

View file

@ -15,7 +15,7 @@ import (
// SimpleSuite
type SimpleSuite struct{ BaseSuite }
func (s *SimpleSuite) TestNoOrInexistentConfigShouldFail(c *check.C) {
func (s *SimpleSuite) TestNoOrInexistentConfigShouldNotFail(c *check.C) {
cmd := exec.Command(traefikBinary)
var b bytes.Buffer
@ -26,7 +26,7 @@ func (s *SimpleSuite) TestNoOrInexistentConfigShouldFail(c *check.C) {
time.Sleep(500 * time.Millisecond)
output := b.Bytes()
c.Assert(string(output), checker.Contains, "No configuration file found")
c.Assert(string(output), checker.Not(checker.Contains), "No configuration file found")
cmd.Process.Kill()
nonExistentFile := "non/existent/file.toml"
@ -39,7 +39,7 @@ func (s *SimpleSuite) TestNoOrInexistentConfigShouldFail(c *check.C) {
time.Sleep(500 * time.Millisecond)
output = b.Bytes()
c.Assert(string(output), checker.Contains, fmt.Sprintf("Error reading configuration file: open %s: no such file or directory", nonExistentFile))
c.Assert(string(output), checker.Not(checker.Contains), fmt.Sprintf("Error reading configuration file: open %s: no such file or directory", nonExistentFile))
cmd.Process.Kill()
}
@ -55,7 +55,7 @@ func (s *SimpleSuite) TestInvalidConfigShouldFail(c *check.C) {
defer cmd.Process.Kill()
output := b.Bytes()
c.Assert(string(output), checker.Contains, "While parsing config: Near line 0 (last key parsed ''): Bare keys cannot contain '{'")
c.Assert(string(output), checker.Contains, "Near line 0 (last key parsed ''): Bare keys cannot contain '{'")
}
func (s *SimpleSuite) TestSimpleDefaultConfig(c *check.C) {