emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/system-packages c4437be 086/117: Add some very simple E


From: Stefan Monnier
Subject: [elpa] externals/system-packages c4437be 086/117: Add some very simple ERT tests
Date: Fri, 14 Dec 2018 17:02:14 -0500 (EST)

branch: externals/system-packages
commit c4437bedfd1800ba572f90f6b051d142a22aa46b
Author: Alex Branham <address@hidden>
Commit: Alex Branham <address@hidden>

    Add some very simple ERT tests
---
 test/system-packages-test.el | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/test/system-packages-test.el b/test/system-packages-test.el
new file mode 100644
index 0000000..26ac4dd
--- /dev/null
+++ b/test/system-packages-test.el
@@ -0,0 +1,35 @@
+;;; system-packages-test.el --- ERT testing framework for system-packages.el  
-*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018  Alex Branham
+
+;; Author: J. Alexander Branham <address@hidden>
+
+(require 'ert)
+
+(ert-deftest system-packages-get-install ()
+  "Return correct installation command."
+  (should (string=
+           (let ((system-packages-use-sudo nil)
+                 (system-packages-package-manager 'guix))
+             (system-packages--get-command 'install))
+           "guix package -i "))
+  (should (string=
+           (let ((system-packages-use-sudo t)
+                 (system-packages-package-manager 'pacman))
+             (system-packages--get-command 'install))
+           "sudo pacman -S ")))
+
+(ert-deftest system-packages-get-install-noconfirm ()
+  "Return correct installation command."
+  (should (string=
+           (let ((system-packages-noconfirm t)
+                 (system-packages-use-sudo nil)
+                 (system-packages-package-manager 'guix))
+             (system-packages--get-command 'install))
+           "guix package -i "))
+  (should (string=
+           (let ((system-packages-noconfirm t)
+                 (system-packages-use-sudo t)
+                 (system-packages-package-manager 'pacman))
+             (system-packages--get-command 'install))
+           "sudo pacman -S --noconfirm")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]