jx/cli_test.go

21 lines
447 B
Go
Raw Normal View History

2024-04-03 18:47:55 +00:00
// 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)
}