summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-02 08:30:37 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-28 22:22:12 -0400
commit0198bf5a793b4de1bd9b6015b16fd4a4921acfa4 (patch)
tree767d8505a0a286d624b6ce3ba2035aa00dbebdcf
parentc6e298ba676dbadfdcfde8a1f1dd5a0d01b619c4 (diff)
downloadguix-0198bf5a793b4de1bd9b6015b16fd4a4921acfa4.tar.gz
gnu: ruby-standard: Enable test suite.
* gnu/packages/ruby.scm (ruby-standard) [arguments]: Delete #:tests? argument.
Delete relax-version-requiremens phase.  Add set-HOME and
delete-problematic-tests phases.
[propagated-inputs]: Add ruby-language-server-protocol.
-rw-r--r--gnu/packages/ruby.scm29
1 files changed, 20 insertions, 9 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 6be813ec8d..7e21ab043a 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1816,17 +1816,28 @@ Batch and flush behavior.
          "0q42gv7wgrc818a5hm599sy07vjq69hbijzpkpgh6jws6x7wzyh3"))))
     (build-system ruby-build-system)
     (arguments
-     ;; TODO: the tests are currently broken due to using a different Rubocop
-     ;; version.
-     `(#:tests? #f
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'relax-version-requiremens
+         (add-after 'unpack 'set-HOME
            (lambda _
-             (delete-file "Gemfile")
-             (delete-file "Gemfile.lock"))))))
-    (native-inputs (list ruby-gimme ruby-pry ruby-simplecov))
-    (propagated-inputs (list ruby-rubocop ruby-rubocop-performance))
+             ;; Some tests fail otherwise.
+             (setenv "HOME" "/tmp")))
+         (add-after 'unpack 'delete-problematic-tests
+           ;; These tests fail for unknown reasons (see:
+           ;; https://github.com/testdouble/standard/issues/532).
+           (lambda _
+             (for-each
+              delete-file
+              '("test/standard_test.rb"
+                "test/standard/cop/block_single_line_braces_test.rb")))))))
+    (native-inputs
+     (list ruby-gimme
+           ruby-pry
+           ruby-simplecov))
+    (propagated-inputs
+     (list ruby-language-server-protocol
+           ruby-rubocop
+           ruby-rubocop-performance))
     (synopsis "Ruby Style Guide, with linter & automatic code fixer")
     (description "Standard is a port of StandardJS.  Like StandardJS, it aims
 to save time in the following ways: