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

     1  package integrationtest
     2  
     3  import "testing"
     4  
     5  import "github.com/involucro/involucro/app"
     6  
     7  func TestParametersAcceptsInlineScript(t *testing.T) {
     8  	if testing.Short() {
     9  		t.SkipNow()
    10  	}
    11  
    12  	assertStdoutContainsFlag([]string{
    13  		"-e",
    14  		"inv.task('echo').using('busybox').run('echo', 'FLAG_293403')",
    15  		"echo",
    16  	}, "FLAG_293403", t)
    17  }
    18  
    19  func TestParametersRejectBothInlineScriptAndFilename(t *testing.T) {
    20  	if testing.Short() {
    21  		t.SkipNow()
    22  	}
    23  
    24  	if err := app.Main([]string{
    25  		"involucro",
    26  		"-e",
    27  		"inv.task('test').runTask('udef')",
    28  		"-f",
    29  		"custom-invfile.lua",
    30  		"test",
    31  	}); err == nil {
    32  		t.Error("Did not fail")
    33  	}
    34  }