cli/runtime_pkg_extra_test.go
google-labs-jules[bot] e4a77cb1ae Implement lifecycle interfaces for Core services (#33)
* Implement Startable and Stoppable lifecycle interfaces

* Refactor tests: remove redundant method overrides in MockLifecycle

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-11-23 19:27:52 +00:00

18 lines
380 B
Go

package core
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewWithFactories_EmptyName(t *testing.T) {
factories := map[string]ServiceFactory{
"": func() (any, error) {
return &MockService{Name: "test"}, nil
},
}
_, err := NewWithFactories(nil, factories)
assert.Error(t, err)
assert.Contains(t, err.Error(), "service name cannot be empty")
}