aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-05-12 16:58:56 +0100
committerChristopher Baines <mail@cbaines.net>2019-05-12 17:32:37 +0100
commit0ab1c71722e81404972f80c91c9717e429d03ec3 (patch)
tree85cfa0cf33dcc6af848bbd92273f202c64f396d0 /tests
parentd2126820613a39be0a8724680e5e4e4ee38ddf84 (diff)
downloaddata-service-0ab1c71722e81404972f80c91c9717e429d03ec3.tar
data-service-0ab1c71722e81404972f80c91c9717e429d03ec3.tar.gz
Add a mock-inferior module
This to help test code which uses the (guix inferior) module.
Diffstat (limited to 'tests')
-rw-r--r--tests/mock-inferior.scm45
1 files changed, 45 insertions, 0 deletions
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?
+ 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>
+ 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)))))))