github.com/thriqon/involucro@v1.1.3/integrationtest/env_in_invfile_test.go (about)

     1  package integrationtest
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  )
     7  
     8  func TestEnvironmentVariables(t *testing.T) {
     9  	if testing.Short() {
    10  		t.SkipNow()
    11  	}
    12  
    13  	os.Setenv("INV_MESSAGE", "inv_message")
    14  	defer os.Setenv("INV_MESSAGE", "")
    15  
    16  	assertStdoutContainsFlag([]string{
    17  		"-e",
    18  		"inv.task('test').using('busybox').withExpectation({stdout = \"inv_message\"}).run('/bin/echo', ENV.INV_MESSAGE)",
    19  		"test",
    20  	}, "inv_message", t)
    21  }