2019-02-03 01:58:18 +00:00
|
|
|
package mtest
|
|
|
|
|
|
|
|
import (
|
|
|
|
. "testing"
|
|
|
|
|
|
|
|
"github.com/mediocregopher/mediocre-go-lib/mcfg"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestRun(t *T) {
|
|
|
|
ctx := NewCtx()
|
2019-02-05 20:18:17 +00:00
|
|
|
ctx, arg := mcfg.RequiredString(ctx, "arg", "Required by this test")
|
|
|
|
ctx = SetEnv(ctx, "ARG", "foo")
|
2019-02-03 01:58:18 +00:00
|
|
|
Run(ctx, t, func() {
|
|
|
|
if *arg != "foo" {
|
|
|
|
t.Fatalf(`arg not set to "foo", is set to %q`, *arg)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|