21 lines
447 B
Go
21 lines
447 B
Go
|
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
||
|
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"os"
|
||
|
"os/exec"
|
||
|
"testing"
|
||
|
"errors"
|
||
|
)
|
||
|
|
||
|
func TestCli(t *testing.T) {
|
||
|
if _, e := os.Stat("./decl"); errors.Is(e, os.ErrNotExist) {
|
||
|
t.Skip("cli not built")
|
||
|
}
|
||
|
yaml, cliErr := exec.Command("./decl", "-import-resource", "file://decl").Output()
|
||
|
assert.Nil(t, cliErr)
|
||
|
assert.Greater(t, len(yaml), 0)
|
||
|
}
|