gopkg.in/masterminds/glide.v0@v0.13.3/action/plugin_test.go (about)

     1  package action
     2  
     3  import (
     4  	"os"
     5  	"runtime"
     6  	"testing"
     7  
     8  	"github.com/Masterminds/glide/msg"
     9  )
    10  
    11  func TestPlugin(t *testing.T) {
    12  	wd, _ := os.Getwd()
    13  	os.Chdir("../testdata/plugin")
    14  	msg.Default.PanicOnDie = true
    15  	var cmd string
    16  
    17  	// Windows scripts for testing (batch) are different from shells scripts.
    18  	// Making sure the plugin works in both bases.
    19  	if runtime.GOOS == "windows" {
    20  		cmd = "hello-win"
    21  	} else {
    22  		cmd = "hello"
    23  	}
    24  	args := []string{"a", "b"}
    25  	// FIXME: Trapping the panic is the nice thing to do.
    26  	Plugin(cmd, args)
    27  	os.Chdir(wd)
    28  }