When libermit
meet with libcompose
.
Note: This is experimental and not even implemented yet. You are on your own right now
This package holds functions and structs to ease docker uses.
package yours
import (
"testing"
"github.com/libkermit/docker/compose"
)
func TestItMyFriend(t *testing.T) {
project, err := compose.CreateProject("simple", "./assets/simple.yml")
if err != nil {
t.Fatal(err)
}
err = project.Start()
if err != nil {
t.Fatal(err)
}
// Do your stuff
err = project.Stop()
if err != nil {
t.Fatal(err)
}
}
This package map the compose
package but takes a *testing.T
struct
on all methods. The idea is to write even less. Let's write the same
example as above.
package yours
import (
"testing"
docker "github.com/libkermit/docker/compose/testing"
)
func TestItMyFriend(t *testing.T) {
project := compose.CreateProject(t, "simple", "./assets/simple.yml")
project.Start(t)
// Do your stuff
project.Stop(t)
}
suite
: functions and structs to setup tests suites.