mirror of
https://github.com/gogrlx/snack.git
synced 2026-04-01 20:58:42 -07:00
fix(test): use non-installed package in dpkg/rpm Install_Unsupported tests
The tests expected Install("tree") to error because dpkg/rpm need
a .deb/.rpm file path. But "tree" is pre-installed in CI containers,
so the code short-circuits to "unchanged" and returns nil.
Use a non-existent package name instead to exercise the actual
install failure path.
This commit is contained in:
@@ -164,7 +164,7 @@ func TestIntegration_Dpkg(t *testing.T) {
|
||||
t.Run("Install_Unsupported", func(t *testing.T) {
|
||||
// dpkg install requires a .deb file path, not a package name
|
||||
// This should fail gracefully
|
||||
_, err := mgr.Install(ctx, snack.Targets("tree"))
|
||||
_, err := mgr.Install(ctx, snack.Targets("nonexistent-pkg-xyzzy"))
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ func TestIntegration_RPM(t *testing.T) {
|
||||
|
||||
// --- Operations rpm doesn't support ---
|
||||
t.Run("Install_Unsupported", func(t *testing.T) {
|
||||
_, err := mgr.Install(ctx, snack.Targets("tree"))
|
||||
_, err := mgr.Install(ctx, snack.Targets("nonexistent-pkg-xyzzy"))
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user