fix TestNoOrInexistentConfigShouldNotFail
This commit is contained in:
parent
629be45c4a
commit
1e27c2dabe
1 changed files with 4 additions and 4 deletions
|
@ -15,7 +15,7 @@ import (
|
||||||
// SimpleSuite
|
// SimpleSuite
|
||||||
type SimpleSuite struct{ BaseSuite }
|
type SimpleSuite struct{ BaseSuite }
|
||||||
|
|
||||||
func (s *SimpleSuite) TestNoOrInexistentConfigShouldFail(c *check.C) {
|
func (s *SimpleSuite) TestNoOrInexistentConfigShouldNotFail(c *check.C) {
|
||||||
cmd := exec.Command(traefikBinary)
|
cmd := exec.Command(traefikBinary)
|
||||||
|
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
|
@ -26,7 +26,7 @@ func (s *SimpleSuite) TestNoOrInexistentConfigShouldFail(c *check.C) {
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
output := b.Bytes()
|
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()
|
cmd.Process.Kill()
|
||||||
|
|
||||||
nonExistentFile := "non/existent/file.toml"
|
nonExistentFile := "non/existent/file.toml"
|
||||||
|
@ -39,7 +39,7 @@ func (s *SimpleSuite) TestNoOrInexistentConfigShouldFail(c *check.C) {
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
output = b.Bytes()
|
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()
|
cmd.Process.Kill()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ func (s *SimpleSuite) TestInvalidConfigShouldFail(c *check.C) {
|
||||||
defer cmd.Process.Kill()
|
defer cmd.Process.Kill()
|
||||||
output := b.Bytes()
|
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) {
|
func (s *SimpleSuite) TestSimpleDefaultConfig(c *check.C) {
|
||||||
|
|
Loading…
Reference in a new issue