Skip to content

Latest commit

 

History

History
76 lines (51 loc) · 1.73 KB

README.md

File metadata and controls

76 lines (51 loc) · 1.73 KB

Libkermit

GoDoc Build Status Go Report Card License codecov

When libermit meet with libcompose.

Note: This is experimental and not even implemented yet. You are on your own right now

Package compose

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)
	}
}

Package compose/testing

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)
}

Other packages to come

  • suite : functions and structs to setup tests suites.