2019-02-03 01:58:18 +00:00
|
|
|
package mtest
|
|
|
|
|
|
|
|
import (
|
|
|
|
. "testing"
|
|
|
|
|
|
|
|
"github.com/mediocregopher/mediocre-go-lib/mcfg"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestRun(t *T) {
|
2019-06-15 23:51:04 +00:00
|
|
|
cmp := Component()
|
|
|
|
Env(cmp, "ARG", "foo")
|
|
|
|
|
|
|
|
arg := mcfg.String(cmp, "arg", mcfg.ParamRequired())
|
|
|
|
Run(cmp, t, func() {
|
2019-02-03 01:58:18 +00:00
|
|
|
if *arg != "foo" {
|
|
|
|
t.Fatalf(`arg not set to "foo", is set to %q`, *arg)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|