github.com/goreleaser/releaser@v0.92.0/internal/testlib/mktemp_test.go (about)

     1  package testlib
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  func TestMkTemp(t *testing.T) {
    11  	current, err := os.Getwd()
    12  	assert.NoError(t, err)
    13  	folder, back := Mktmp(t)
    14  	assert.NotEmpty(t, folder)
    15  	back()
    16  	newCurrent, err := os.Getwd()
    17  	assert.NoError(t, err)
    18  	assert.Equal(t, current, newCurrent)
    19  }