From 22699f8de5229cec33b3ce5f925cd7ba814b80d2 Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Mon, 3 Jul 2023 19:41:14 +0200 Subject: [PATCH] Fix package_test --- main.go | 2 +- pkg/package_test.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 02e31f4..f7522f4 100644 --- a/main.go +++ b/main.go @@ -307,7 +307,7 @@ func main() { app := cli.NewApp() app.Name = "rz-pm" app.Usage = "Rizin package manager" - app.Version = "v0.3.0" + app.Version = "v0.3.1" cli.AppHelpTemplate = fmt.Sprintf(`%s RZ_PM_SITE: diff --git a/pkg/package_test.go b/pkg/package_test.go index 59656e4..e66c670 100644 --- a/pkg/package_test.go +++ b/pkg/package_test.go @@ -79,6 +79,9 @@ func (s FakeSite) IsPackageInstalled(pkg Package) bool { func (s FakeSite) GetPackage(name string) (Package, error) { return RizinPackage{}, nil } +func (s FakeSite) GetInstalledPackage(name string) (InstalledPackage, error) { + return InstalledPackage{}, nil +} func (s FakeSite) GetPackageFromFile(filename string) (Package, error) { return RizinPackage{}, nil } @@ -208,10 +211,10 @@ func TestDownloadGitPackage(t *testing.T) { err = p.Download(tmpPath) assert.NoError(t, err, "simple package should be downloaded") - _, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "simple-git")) + _, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "jsdec")) assert.NoError(t, err, "simple-git(jsdec) dir should be there") - _, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "simple-git", ".git")) + _, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "jsdec", ".git")) assert.NoError(t, err, "simple-git(jsdec) master branch should have been git cloned") - _, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "simple-git", "p")) + _, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "jsdec", "p")) assert.NoError(t, err, "simple-git(jsdec)/p should be there") }