2020-03-12 21:47:31 +01:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
)
|
|
|
|
|
2020-09-29 00:57:45 +02:00
|
|
|
func TestZeroThirteenUpgrade(t *testing.T) {
|
2020-05-08 20:09:13 +02:00
|
|
|
ui := new(cli.MockUi)
|
|
|
|
c := &ZeroThirteenUpgradeCommand{
|
|
|
|
Meta: Meta{
|
2020-09-29 00:57:45 +02:00
|
|
|
Ui: ui,
|
2020-05-08 20:09:13 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-09-29 00:57:45 +02:00
|
|
|
if code := c.Run([]string{}); code != 0 {
|
2020-05-08 20:09:13 +02:00
|
|
|
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
|
|
|
}
|
|
|
|
|
|
|
|
output := ui.OutputWriter.String()
|
2020-09-29 00:57:45 +02:00
|
|
|
if !strings.Contains(output, "The 0.13upgrade command has been removed.") {
|
2020-05-08 20:09:13 +02:00
|
|
|
t.Fatal("unexpected output:", output)
|
|
|
|
}
|
|
|
|
}
|