Skip to content

Commit

Permalink
Convert to string once
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-osborn committed Sep 7, 2022
1 parent 41c91f0 commit 2e0ae98
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/nginx/config/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ func TestGenerate(t *testing.T) {
},
}

cfg := generator.Generate(conf)
cfg := string(generator.Generate(conf))

if !strings.Contains(string(cfg), "listen 80") {
t.Errorf("Generate() did not generate a config with an HTTP server; config: %s", string(cfg))
if !strings.Contains(cfg, "listen 80") {
t.Errorf("Generate() did not generate a config with an HTTP server; config: %s", cfg)
}

if !strings.Contains(string(cfg), "listen 443") {
t.Errorf("Generate() did not generate a config with an SSL server; config: %s", string(cfg))
if !strings.Contains(cfg, "listen 443") {
t.Errorf("Generate() did not generate a config with an SSL server; config: %s", cfg)
}

if !strings.Contains(string(cfg), "upstream") {
t.Errorf("Generate() did not generate a config with an upstream block; config: %s", string(cfg))
if !strings.Contains(cfg, "upstream") {
t.Errorf("Generate() did not generate a config with an upstream block; config: %s", cfg)
}
}

Expand Down

0 comments on commit 2e0ae98

Please sign in to comment.