guix-commits
[Top][All Lists]
Advanced

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

02/16: tests: Avoid unnecessary use of 'mock'.


From: guix-commits
Subject: 02/16: tests: Avoid unnecessary use of 'mock'.
Date: Mon, 25 Nov 2019 18:17:07 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit f5698dfb87df1132ca5c73a8ed7f75f63c07669f
Author: Ludovic Courtès <address@hidden>
Date:   Sun Nov 24 20:48:11 2019 +0100

    tests: Avoid unnecessary use of 'mock'.
    
    * tests/build-utils.scm ("wrap-script, simple case"): Use the real
    'which' instead of mocking it.
---
 tests/build-utils.scm | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/build-utils.scm b/tests/build-utils.scm
index ec442c2..47a57a9 100644
--- a/tests/build-utils.scm
+++ b/tests/build-utils.scm
@@ -151,11 +151,12 @@ echo hello world"))
   (test-equal "wrap-script, simple case"
     (string-append
      (format #f "\
-#!GUILE --no-auto-compile
+#!~a --no-auto-compile
 #!#; Guix wrapper
 #\\-~s
 #\\-~s
 "
+             (which "guile")
              '(begin (let ((current (getenv "GUIX_FOO")))
                        (setenv "GUIX_FOO"
                                (if current
@@ -175,11 +176,9 @@ echo hello world"))
            (lambda (port)
              (format port script-contents)))
          (chmod script-file-name #o777)
-
-         (mock ((guix build utils) which (const "GUILE"))
-               (wrap-script script-file-name
-                            `("GUIX_FOO" prefix ("/some/path"
-                                                 "/some/other/path"))))
+         (wrap-script script-file-name
+                      `("GUIX_FOO" prefix ("/some/path"
+                                           "/some/other/path")))
          (let ((str (call-with-input-file script-file-name get-string-all)))
            (with-directory-excursion directory
              (delete-file "foo"))



reply via email to

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