github.com/franklinhu/terraform@v0.6.9-0.20151202232446-81f7fb1e6f9e/command/ui_input_test.go (about)

     1  package command
     2  
     3  import (
     4  	"bytes"
     5  	"testing"
     6  
     7  	"github.com/hashicorp/terraform/terraform"
     8  )
     9  
    10  func TestUIInput_impl(t *testing.T) {
    11  	var _ terraform.UIInput = new(UIInput)
    12  }
    13  
    14  func TestUIInputInput(t *testing.T) {
    15  	i := &UIInput{
    16  		Reader: bytes.NewBufferString("foo\n"),
    17  		Writer: bytes.NewBuffer(nil),
    18  	}
    19  
    20  	v, err := i.Input(&terraform.InputOpts{})
    21  	if err != nil {
    22  		t.Fatalf("err: %s", err)
    23  	}
    24  
    25  	if v != "foo" {
    26  		t.Fatalf("bad: %#v", v)
    27  	}
    28  }