summary refs log tree commit diff
path: root/gnu/packages/ruby.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-07-09 12:01:36 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-07-11 14:26:58 -0400
commitdf32ab1196e69c8d769de5effb5b485c780bff96 (patch)
treeb08943713d23f7e240158df51140862e24821f35 /gnu/packages/ruby.scm
parent65a61239517f6b45a8728657d55102d2373fe915 (diff)
downloadguix-df32ab1196e69c8d769de5effb5b485c780bff96.tar.gz
gnu: Add ruby-yard-with-tests.
* gnu/packages/ruby.scm (ruby-yard-with-tests): New variable.
Diffstat (limited to 'gnu/packages/ruby.scm')
-rw-r--r--gnu/packages/ruby.scm27
1 files changed, 27 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 72cdeced43..7071fb3dab 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -7014,6 +7014,33 @@ definitions.")
     (home-page "https://yardoc.org")
     (license license:expat)))
 
+(define-public ruby-yard-with-tests
+  (package
+    (inherit ruby-yard)
+    (name "ruby-yard-with-tests")
+    (arguments
+     (substitute-keyword-arguments (package-arguments ruby-yard)
+       ((#:tests? _ #t) #t)
+       ((#:test-target _ "default") "default")
+       ((#:phases phases '%standard-phases)
+        `(modify-phases ,phases
+           (add-before 'check 'prepare-for-tests
+             (lambda* (#:key tests? #:allow-other-keys)
+               (when tests?
+                 (substitute* "Rakefile"
+                   ((".*[Ss]amus.*") ""))
+                 ;; Delete the Gemfile to avoid errors relating to it.
+                 (delete-file "Gemfile")
+                 ;; $HOME needs to be set to somewhere writeable for tests to
+                 ;; run.
+                 (setenv "HOME" "/tmp"))
+               #t))))))
+    (native-inputs
+     `(("ruby-rspec" ,ruby-rspec)
+       ("ruby-rack" ,ruby-rack)
+       ("ruby-redcloth" ,ruby-redcloth)
+       ("ruby-asciidoc" ,ruby-asciidoctor)))))
+
 (define-public ruby-clap
   (package
     (name "ruby-clap")