Mamoru TASAKA 3 years ago
parent 97dd4e0b1d
commit f1928d6977

@ -1,74 +0,0 @@
From 01f468c61eecc83d931cb56434394770557c60c7 Mon Sep 17 00:00:00 2001
From: Matijs van Zuijlen <matijs@matijs.net>
Date: Sun, 16 Jan 2022 11:29:55 +0100
Subject: [PATCH] Ensure Gem.win_platform? is available
Even though rubygems is nearly always loaded by ruby automatically, it
is possible to avoid doing so. Therefore, to make platform detection
work, we have to require "rubygems" explicitly.
---
lib/aruba/platforms/unix_platform.rb | 1 +
spec/aruba/platforms/unix_platform_spec.rb | 18 ++++++++++++++++++
spec/aruba/platforms/windows_platform_spec.rb | 18 ++++++++++++++++++
3 files changed, 37 insertions(+)
create mode 100644 spec/aruba/platforms/unix_platform_spec.rb
create mode 100644 spec/aruba/platforms/windows_platform_spec.rb
diff --git a/lib/aruba/platforms/unix_platform.rb b/lib/aruba/platforms/unix_platform.rb
index 2831bbb26..51f653ff9 100644
--- a/lib/aruba/platforms/unix_platform.rb
+++ b/lib/aruba/platforms/unix_platform.rb
@@ -1,4 +1,5 @@
require "rbconfig"
+require "rubygems"
require "pathname"
require "aruba/aruba_path"
diff --git a/spec/aruba/platforms/unix_platform_spec.rb b/spec/aruba/platforms/unix_platform_spec.rb
new file mode 100644
index 000000000..75718f726
--- /dev/null
+++ b/spec/aruba/platforms/unix_platform_spec.rb
@@ -0,0 +1,18 @@
+require "spec_helper"
+require "aruba/platforms/unix_platform"
+
+RSpec.describe Aruba::Platforms::UnixPlatform do
+ include_context "uses aruba API"
+
+ describe ".match?" do
+ it "works even when ruby is launched with --disable-gems and --disable-rubyopt" do
+ aruba_lib = File.expand_path("../../../lib", __dir__)
+ run_command_and_stop(
+ "ruby --disable-rubyopt --disable-gems -I#{aruba_lib}" \
+ " -e 'require \"aruba/platforms/unix_platform\";" \
+ " Aruba::Platforms::UnixPlatform.match?;'"
+ )
+ expect(last_command_started).to be_successfully_executed
+ end
+ end
+end
diff --git a/spec/aruba/platforms/windows_platform_spec.rb b/spec/aruba/platforms/windows_platform_spec.rb
new file mode 100644
index 000000000..5ae02e8ab
--- /dev/null
+++ b/spec/aruba/platforms/windows_platform_spec.rb
@@ -0,0 +1,18 @@
+require "spec_helper"
+require "aruba/platforms/windows_platform"
+
+RSpec.describe Aruba::Platforms::WindowsPlatform do
+ include_context "uses aruba API"
+
+ describe ".match?" do
+ it "works even when ruby is launched with --disable-gems and --disable-rubyopt" do
+ aruba_lib = File.expand_path("../../../lib", __dir__)
+ run_command_and_stop(
+ "ruby --disable-rubyopt --disable-gems -I#{aruba_lib}" \
+ " -e 'require \"aruba/platforms/windows_platform\";" \
+ " Aruba::Platforms::WindowsPlatform.match?;'"
+ )
+ expect(last_command_started).to be_successfully_executed
+ end
+ end
+end

@ -3,8 +3,8 @@
Summary: CLI Steps for Cucumber, hand-crafted for you in Aruba
Name: rubygem-%{gem_name}
Version: 2.0.0
Release: 4%{?dist}
Version: 2.0.1
Release: 1%{?dist}
# aruba itself is MIT
# icons in templates/images are CC-BY
@ -18,10 +18,6 @@ Source1: %{name}-%{version}-testsuite.tar.gz
Source2: %{gem_name}-create-test-suite-tarball.sh
# Make bundler runtime dependency optional
Patch1: rubygem-aruba-2.0.0-make-bundler-optional.patch
# Make rspec-core rspec test suite pass
# https://github.com/cucumber/aruba/issues/852
# https://github.com/cucumber/aruba/pull/858
Patch2: rubygem-aruba-2.0.0-ensure-Gem-win_platform-is-available.patch
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
@ -66,7 +62,6 @@ done
ln -sf ../lib
popd
%patch1 -p1
%patch2 -p1
mv ../%{gem_name}-%{version}.gemspec .
@ -174,6 +169,9 @@ popd # from .%%{gem_instdir}
%doc %{gem_instdir}/CHANGELOG.md
%changelog
* Sun Apr 24 2022 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.0.1-1
- 2.0.1
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

@ -1,2 +1,2 @@
SHA512 (aruba-2.0.0.gem) = 798a5aaf1f03132eb1e6872be93e61d0a0aa7ec21f0783110132207c357240dee2a0e75f5c9f7d91d4d471d38d385deccfaa07c31a43cc8cb8c54d6156b762f9
SHA512 (rubygem-aruba-2.0.0-testsuite.tar.gz) = 67fd9c892a9da66d686baeb377748aea843872344e7a04c0f0910e1123bc8be9c66fe12fb56a2657388568ec0c586970aba8a3da4a1816ecbcbe42a843e8e80a
SHA512 (aruba-2.0.1.gem) = a83bdf722eb5ed6617c5296bc79c057b88b775aaccb6c570933c6c3cf52ea7119a3264dc955d2130d41084d8a478153b06af1610143f41d24c9785ae3acaf72b
SHA512 (rubygem-aruba-2.0.1-testsuite.tar.gz) = 21e5b201950879c63057c67e68a77eb7ef60001b90050e3dd2d368e0244cdb64b93a5f8dbe4170bec1e3eff775b8aa82a03863b7e02d0cd7869442b621956c03

Loading…
Cancel
Save