summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-05-20 17:54:02 +0200
committerMarius Bakke <mbakke@fastmail.com>2020-05-20 23:51:25 +0200
commit6623a1512333479107c31137efec412d4d9d4585 (patch)
treeeea5614cb983c9e3eb7120531fc54ce2434ced0a /gnu
parent8d85543b6a0df8abf35bd317588deb81c1726602 (diff)
downloadguix-6623a1512333479107c31137efec412d4d9d4585.tar.gz
gnu: Add ruby-fakefs.
* gnu/packages/ruby.scm (ruby-fakefs): New public variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/ruby.scm44
1 files changed, 44 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 36cb42e300..83dea8d37a 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1542,6 +1542,50 @@ a Ruby object.")
     (home-page "https://github.com/rails/execjs")
     (license license:expat)))
 
+(define-public ruby-fakefs
+  (package
+    (name "ruby-fakefs")
+    (version "1.2.2")
+    (home-page "https://github.com/fakefs/fakefs")
+    (source (origin
+              ;; The Rubygems release does not contain tests.
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "008dq9knyip2bfbl0mrk8b8r7bv0k3bf128wcfqsgy1rqal4mgwk"))))
+    (build-system ruby-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (replace 'replace-git-ls-files
+                    (lambda _
+                      (substitute* "fakefs.gemspec"
+                        (("`git ls-files lib README.md LICENSE`")
+                         "`find lib README.md LICENSE -type f | sort`"))
+                      #t))
+                  (add-before 'check 'remove-version-constraints
+                    (lambda _
+                      ;; Drop hard version requirements for test dependencies.
+                      (substitute* "fakefs.gemspec"
+                        (("(.*add_development_dependency .*), .*" _ dep)
+                         (string-append dep "\n")))
+                      #t))
+                  )))
+    (native-inputs
+     `(("ruby-bump" ,ruby-bump)
+       ("ruby-maxitest" ,ruby-maxitest)
+       ("ruby-rubocop" ,ruby-rubocop)
+       ("ruby-rspec" ,ruby-rspec)))
+    (synopsis "Fake file system for Ruby")
+    (description
+     "This package provides a fake file system for use in test suites.  It
+avoids the need for manually creating temporary directories, or dealing
+with platform intricacies in @code{File} and @code{FileUtils}.")
+    (license license:expat)))
+
 (define-public ruby-orderedhash
   (package
     (name "ruby-orderedhash")