Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ func Exec(o *option.Option) {
ginkgo.AfterEach(func() {
command.RemoveAll(o)
})

ginkgo.It("should not panic when exec without arguments", func() {
// Test finch exec without arguments - should show help, not panic
session := command.New(o, "exec").WithoutCheckingExitCode().Run()
gomega.Expect(session.Out.Contents()).ShouldNot(gomega.BeEmpty()) // Should have output
})
// TODO: specifying -t flag will have error in test -> panic: provided file is not a console
ginkgo.When("then container is running", func() {
ginkgo.BeforeEach(func() {
Expand Down
6 changes: 6 additions & 0 deletions tests/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ func Run(o *RunOption) {
command.RemoveAll(o.BaseOpt)
})

ginkgo.It("should not panic when run without arguments", func() {
// Test finch run without arguments - should show help, not panic
session := command.New(o.BaseOpt, "run").WithoutCheckingExitCode().Run()
gomega.Expect(session.Out.Contents()).ShouldNot(gomega.BeEmpty()) // Should have output
})

ginkgo.When("running a container that echos dummy output", func() {
ginkgo.BeforeEach(func() {
dockerfile := fmt.Sprintf(`FROM %s
Expand Down