summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-04-11 21:35:54 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-04-11 21:38:22 -0400
commit99c468b0647b1042ae4cd5f2d01f1e258235a837 (patch)
tree84bccff7f19050839aa8112f3d6c43413c96d4eb /gnu/packages
parent3ab983d630a95a29b9418b1ba8a26e5ca2836ec0 (diff)
downloadguix-99c468b0647b1042ae4cd5f2d01f1e258235a837.tar.gz
gnu: ruby-rubyzip: Re-instate all tests.
* gnu/packages/ruby.scm (ruby-rubyzip)
[arguments]: Do not patch ruby shebang in the patch-tests phase.
Remove the disable-problematic-tests phase.  Add the
unpatch-some-source-shebangs phase.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/ruby.scm31
1 files changed, 9 insertions, 22 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 203b5754ff..6c212b9470 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -3694,29 +3694,16 @@ Ruby Gems.")
          (add-before 'check 'patch-tests
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "test/gentestfiles.rb"
-               (("/usr/bin/zip") (which "zip")))
-             (substitute* "test/input_stream_test.rb"
-               (("/usr/bin/env ruby") (which "ruby")))))
-         (add-before 'check 'disable-problematic-tests
+               (("/usr/bin/zip") (which "zip")))))
+         (add-after 'patch-source-shebangs 'unpatch-some-source-shebangs
            (lambda _
-             (let-syntax ((skip-tests
-                           (syntax-rules ()
-                             ((_ file test ...)
-                              (substitute* file
-                                (((string-append "def " test ".*") all)
-                                 (string-append
-                                  all "    skip('fails on guix')\n")) ...)))))
-               ;; The test failures were reported here:
-               ;; https://github.com/rubyzip/rubyzip/issues/552.
-               (skip-tests "test/stored_support_test.rb"
-                           "test_read")
-               (skip-tests "test/stored_support_test.rb"
-                           "test_encrypted_read")
-               (skip-tests "test/output_stream_test.rb"
-                           "test_put_next_entry_using_zip_entry_creates_\
-entries_with_correct_timestamps")
-               (skip-tests "test/file_options_test.rb"
-                           "test_restore_times_true")))))))
+             ;; The tests compare zipped files with data test files; since the
+             ;; zip files do not have their shebangs patched, the data files
+             ;; compared with their extracted version must also be left
+             ;; un-patched.
+             (substitute* (find-files "test/data" "\\.(txt|rb)$")
+               (((which "ruby"))
+                "/usr/bin/env ruby")))))))
     (native-inputs
      (list bundler ruby-simplecov zip unzip))
     (synopsis "Ruby module is for reading and writing zip files")