github.com/daniel-garcia/glide@v0.0.0-20160218012856-2eab91fab790/action/list_test.go (about)

     1  package action
     2  
     3  import (
     4  	"bytes"
     5  	"testing"
     6  
     7  	"github.com/Masterminds/glide/msg"
     8  )
     9  
    10  func TestList(t *testing.T) {
    11  	var buf bytes.Buffer
    12  	old := msg.Default.Stdout
    13  	msg.Default.PanicOnDie = true
    14  	msg.Default.Stdout = &buf
    15  	List("../", false)
    16  	if buf.Len() < 5 {
    17  		t.Error("Expected some data to be found.")
    18  	}
    19  	// TODO: We should capture and test output.
    20  	msg.Default.Stdout = old
    21  }