Skip to content

Commit

Permalink
Merge pull request #858 from cucumber/require-rubygems
Browse files Browse the repository at this point in the history
Ensure Gem.win_platform? is available
  • Loading branch information
mvz authored Jan 16, 2022
2 parents 76d7240 + 01f468c commit 629a8c2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/aruba/platforms/unix_platform.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "rbconfig"
require "rubygems"
require "pathname"

require "aruba/aruba_path"
Expand Down
18 changes: 18 additions & 0 deletions spec/aruba/platforms/unix_platform_spec.rb
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions spec/aruba/platforms/windows_platform_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 629a8c2

Please sign in to comment.