github.com/bhameyie/otto@v0.2.1-0.20160406174117-16052efa52ec/command/command_test.go (about)

     1  package command
     2  
     3  import (
     4  	"os"
     5  	"path/filepath"
     6  )
     7  
     8  func init() {
     9  	testingMode = true
    10  }
    11  
    12  func fixtureDir(n string) string {
    13  	return filepath.Join("./test-fixtures", n)
    14  }
    15  
    16  func testEnv(k, v string) func() {
    17  	old := os.Getenv(v)
    18  	os.Setenv(k, v)
    19  	return func() { os.Setenv(k, old) }
    20  }