2014-10-28 18:09:22 -04:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
2014-10-28 22:29:51 -04:00
|
|
|
"path/filepath"
|
2014-10-28 18:09:22 -04:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
)
|
|
|
|
|
2014-10-28 22:29:51 -04:00
|
|
|
const fixturesDir = "./test-fixtures"
|
|
|
|
|
|
|
|
func fatalCommand(t *testing.T, m Meta) {
|
|
|
|
ui := m.Ui.(*cli.MockUi)
|
|
|
|
t.Fatalf(
|
|
|
|
"Bad exit code.\n\nStdout:\n\n%s\n\nStderr:\n\n%s",
|
|
|
|
ui.OutputWriter.String(),
|
|
|
|
ui.ErrorWriter.String())
|
|
|
|
}
|
|
|
|
|
|
|
|
func testFixture(n string) string {
|
|
|
|
return filepath.Join(fixturesDir, n)
|
|
|
|
}
|
|
|
|
|
2014-10-28 18:09:22 -04:00
|
|
|
func testMeta(t *testing.T) Meta {
|
|
|
|
return Meta{
|
|
|
|
Ui: new(cli.MockUi),
|
|
|
|
}
|
|
|
|
}
|