vaguerent/internal/plugin/testing_manager.go
2022-04-25 12:26:40 -05:00

20 lines
433 B
Go

package plugin
import (
"context"
"github.com/hashicorp/go-hclog"
"github.com/mitchellh/go-testing-interface"
)
// TestManager returns a fully in-memory and side-effect free Manager that
// can be used for testing.
func TestManager(t testing.T, plugins ...*Plugin) *Manager {
pluginManager := NewManager(
context.Background(),
hclog.New(&hclog.LoggerOptions{}),
)
pluginManager.Plugins = plugins
return pluginManager
}