2014-09-29 12:36:49 -05:00
|
|
|
package terraform
|
|
|
|
|
|
|
|
import (
|
2019-03-07 14:07:13 -06:00
|
|
|
"context"
|
2014-09-29 12:36:49 -05:00
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestPrefixUIInput_impl(t *testing.T) {
|
|
|
|
var _ UIInput = new(PrefixUIInput)
|
|
|
|
}
|
|
|
|
|
2020-10-07 10:00:06 -05:00
|
|
|
func TestPrefixUIInput(t *testing.T) {
|
2014-09-29 12:36:49 -05:00
|
|
|
input := new(MockUIInput)
|
|
|
|
prefix := &PrefixUIInput{
|
|
|
|
IdPrefix: "foo",
|
|
|
|
UIInput: input,
|
|
|
|
}
|
|
|
|
|
2019-03-07 14:07:13 -06:00
|
|
|
_, err := prefix.Input(context.Background(), &InputOpts{Id: "bar"})
|
2014-09-29 12:36:49 -05:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if input.InputOpts.Id != "foo.bar" {
|
|
|
|
t.Fatalf("bad: %#v", input.InputOpts)
|
|
|
|
}
|
|
|
|
}
|