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
|
|
@ -1,2 +1,2 @@
|
|||||||
SHA512 (aruba-2.0.0.gem) = 798a5aaf1f03132eb1e6872be93e61d0a0aa7ec21f0783110132207c357240dee2a0e75f5c9f7d91d4d471d38d385deccfaa07c31a43cc8cb8c54d6156b762f9
|
SHA512 (aruba-2.0.1.gem) = a83bdf722eb5ed6617c5296bc79c057b88b775aaccb6c570933c6c3cf52ea7119a3264dc955d2130d41084d8a478153b06af1610143f41d24c9785ae3acaf72b
|
||||||
SHA512 (rubygem-aruba-2.0.0-testsuite.tar.gz) = 67fd9c892a9da66d686baeb377748aea843872344e7a04c0f0910e1123bc8be9c66fe12fb56a2657388568ec0c586970aba8a3da4a1816ecbcbe42a843e8e80a
|
SHA512 (rubygem-aruba-2.0.1-testsuite.tar.gz) = 21e5b201950879c63057c67e68a77eb7ef60001b90050e3dd2d368e0244cdb64b93a5f8dbe4170bec1e3eff775b8aa82a03863b7e02d0cd7869442b621956c03
|
||||||
|
Loading…
Reference in new issue