diff options
author | Sam James <sam@gentoo.org> | 2023-03-22 06:58:52 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-03-22 07:35:10 +0000 |
commit | 4752060b39b25ee94669267dc89ae689f83f1286 (patch) | |
tree | 34873017f94325661193dd2252e54877c98072ac /dev-ruby/simplecov | |
parent | dev-ruby/simplecov-html: update HOMEPAGE (diff) | |
download | gentoo-4752060b39b25ee94669267dc89ae689f83f1286.tar.gz gentoo-4752060b39b25ee94669267dc89ae689f83f1286.tar.bz2 gentoo-4752060b39b25ee94669267dc89ae689f83f1286.zip |
dev-ruby/simplecov: enable ruby32 (w/ fixed tests)
This test is only activated for >= ruby32 because ruby32 adds support
for assessing coverage within an eval. But the failure isn't anything
to do with eval.
The test tries to call 'ruby' which in Gentoo isn't (yet!) wrapped,
so it ends up calling an older Ruby which then results in 0 coverage
being found. Replace it with a string we can safely sed with the
correct Ruby per-test.
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-ruby/simplecov')
-rw-r--r-- | dev-ruby/simplecov/files/simplecov-0.22.0-ruby32-gentoo.patch | 19 | ||||
-rw-r--r-- | dev-ruby/simplecov/simplecov-0.22.0.ebuild | 13 |
2 files changed, 27 insertions, 5 deletions
diff --git a/dev-ruby/simplecov/files/simplecov-0.22.0-ruby32-gentoo.patch b/dev-ruby/simplecov/files/simplecov-0.22.0-ruby32-gentoo.patch new file mode 100644 index 000000000000..293fbe51d747 --- /dev/null +++ b/dev-ruby/simplecov/files/simplecov-0.22.0-ruby32-gentoo.patch @@ -0,0 +1,19 @@ +This test is only activated for >= ruby32 because ruby32 adds support +for assessing coverage within an eval. But the failure isn't anything +to do with eval. + +The test tries to call 'ruby' which in Gentoo isn't (yet!) wrapped, +so it ends up calling an older Ruby which then results in 0 coverage +being found. Replace it with a string we can safely sed with the +correct Ruby per-test. +--- a/spec/coverage_for_eval_spec.rb ++++ b/spec/coverage_for_eval_spec.rb +@@ -16,7 +16,7 @@ RSpec.describe "coverage for eval" do + end + + context "foo" do +- let(:command) { "ruby eval_test.rb" } ++ let(:command) { "@GENTOO_RUBY@ eval_test.rb" } + + it "records coverage for erb" do + expect(@stdout).to include(" 2 / 3 LOC") diff --git a/dev-ruby/simplecov/simplecov-0.22.0.ebuild b/dev-ruby/simplecov/simplecov-0.22.0.ebuild index 1f2ded59ddcd..22e7cc4d0130 100644 --- a/dev-ruby/simplecov/simplecov-0.22.0.ebuild +++ b/dev-ruby/simplecov/simplecov-0.22.0.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -USE_RUBY="ruby27 ruby30 ruby31" +USE_RUBY="ruby27 ruby30 ruby31 ruby32" RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md" @@ -36,6 +36,10 @@ ruby_add_bdepend "test? ( # There are also cucumber tests that require poltergeist and unpackaged phantomjs gem. +PATCHES=( + "${FILESDIR}"/${PN}-0.22.0-ruby32-gentoo.patch +) + all_ruby_prepare() { # Avoid test depending on spawning ruby and having timing issues sed -i -e '/blocks other processes/askip "gentoo"' spec/result_merger_spec.rb || die @@ -48,7 +52,6 @@ all_ruby_prepare() { } each_ruby_test() { - RSPEC_VERSION=3 ruby-ng_rspec spec/*spec.rb || die - - #${RUBY} -S cucumber features || die + sed -i -e "s:@GENTOO_RUBY@:${RUBY}:" spec/coverage_for_eval_spec.rb || die + RSPEC_VERSION=3 ruby-ng_rspec spec/ || die } |