25 lines
645 B
Go
25 lines
645 B
Go
package archive_test
|
|
|
|
import (
|
|
"context"
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/leonmika/wails-release/internal/archive"
|
|
"github.com/leonmika/wails-release/internal/runner"
|
|
)
|
|
|
|
func TestZipApp_BuildsCorrectDittoArgs(t *testing.T) {
|
|
f := &runner.Fake{}
|
|
f.On("ditto", nil).Return(nil, nil)
|
|
|
|
err := archive.ZipApp(context.Background(), f, "/build/MyApp.app", "/dist/MyApp-1.2.3.app.zip")
|
|
if err != nil {
|
|
t.Fatalf("unexpected: %v", err)
|
|
}
|
|
want := []string{"-c", "-k", "--keepParent", "/build/MyApp.app", "/dist/MyApp-1.2.3.app.zip"}
|
|
if !reflect.DeepEqual(f.Calls[0].Args, want) {
|
|
t.Fatalf("args got %v want %v", f.Calls[0].Args, want)
|
|
}
|
|
}
|