From 0ab1c71722e81404972f80c91c9717e429d03ec3 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 12 May 2019 16:58:56 +0100 Subject: Add a mock-inferior module This to help test code which uses the (guix inferior) module. --- tests/mock-inferior.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/mock-inferior.scm (limited to 'tests') diff --git a/tests/mock-inferior.scm b/tests/mock-inferior.scm new file mode 100644 index 0000000..6424cd9 --- /dev/null +++ b/tests/mock-inferior.scm @@ -0,0 +1,45 @@ +(define-module (tests mock-inferior) + #:use-module (guix records) + #:use-module (guix tests) + #:export ( + mock-inferior-package + mock-inferior-package? + mock-inferior-package-name + mock-inferior-package-version + mock-inferior-package-synopsis + mock-inferior-package-description + mock-inferior-package-home-page + + with-mock-inferior-packages)) + +(define-record-type* + mock-inferior-package make-mock-inferior-pacakge + mock-inferior-package? + (name mock-inferior-package-name) + (version mock-inferior-package-version) + (synopsis mock-inferior-package-synopsis) + (description mock-inferior-package-description) + (home-page mock-inferior-package-home-page)) + +(define (with-mock-inferior-packages f) + (mock + ((guix inferior) + inferior-package-name + mock-inferior-package-name) + (mock + ((guix inferior) + inferior-package-version + mock-inferior-package-version) + (mock + ((guix inferior) + inferior-package-synopsis + mock-inferior-package-synopsis) + (mock + ((guix inferior) + inferior-package-description + mock-inferior-package-description) + (mock + ((guix inferior) + inferior-package-home-page + mock-inferior-package-home-page) + (f))))))) -- cgit v1.2.3