[PATCH] gnu: ruby-ethon: Enable tests.

  • Open
  • quality assurance status badge
Details
One participant
  • gemmaro
Owner
unassigned
Submitted by
gemmaro
Severity
normal
G
G
gemmaro wrote on 4 Nov 08:14 +0100
(address . guix-patches@gnu.org)(name . gemmaro)(address . gemmaro.dev@gmail.com)
9e9174d6e714f9ce79d8e725130e4ad669b65fd4.1730704468.git.gemmaro.dev@gmail.com
* gnu/packages/ruby.scm (ruby-ethon): Enable tests.
[source]: Switch to use the Git repository, which includes test files.
[arguments]<#:tests?>: Remove it to enable tests by default.
<#:phases>: Add a phase to relax the mime-types gem version constraint.
Add a phase to remove Bundler setup, and replace the check phase to directly
run RSpec, in order to avoid perf dependencies.
Because of this, #:test-target is not needed to be "spec".
[native-inputs]: Add test dependencies.

Change-Id: Ie46d682ccb5e9b5048a109cd8587e2178c34f8ec
---
gnu/packages/ruby.scm | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)

Toggle diff (58 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 12c439b3a9..3f0d32e8b5 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -3082,22 +3082,44 @@ (define-public ruby-ethon
(version "0.12.0")
(source
(origin
- (method url-fetch)
- (uri (rubygems-uri "ethon" version))
+ (method git-fetch) ;for tests
+ (uri (git-reference
+ (url "https://github.com/typhoeus/ethon")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
(sha256
(base32
- "0gggrgkcq839mamx7a8jbnp2h7x2ykfn34ixwskwb0lzx2ak17g9"))))
+ "0f29h4slja66kkc675rk4nnsxzhlgb143whx4ffx250w36ih0aq3"))))
(build-system ruby-build-system)
(arguments
(list
- #:tests? #f ; no included tests
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'libcurl-use-absolute-reference
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "lib/ethon/curls/settings.rb"
(("libcurl', 'libcurl\\.so\\.4")
- (search-input-file inputs "/lib/libcurl.so"))))))))
+ (search-input-file inputs "/lib/libcurl.so")))))
+ (add-after 'extract-gemspec 'remove-MIME-types-version-constraint
+ (lambda _
+ (substitute* "Gemfile"
+ (("(gem \"mime-types\").*" _ gem)
+ gem))))
+
+ ;; Tell Bundler not to request perf dependencies
+ (add-after 'extract-gemspec 'remove-Bundler-setup
+ (lambda _
+ (substitute* "spec/spec_helper.rb"
+ (("Bundler.setup")
+ ""))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (for-each (lambda (file)
+ (invoke "ruby" "-Ispec" file))
+ (find-files "spec" "_spec\\.rb$"))))))))
+ (native-inputs (list ruby-rspec ruby-sinatra ruby-mustermann
+ ruby-mime-types ruby-webrick))
(inputs
(list curl))
(propagated-inputs

base-commit: 547d97180471e90e404a948015f65431961aa273
--
2.46.0
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 74201@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74201
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch