summaryrefslogtreecommitdiff
path: root/spec/install/gemfile
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-07-26 06:40:29 +0000
committerBundlerbot <bot@bundler.io>2019-07-26 06:40:29 +0000
commit6ac096f829965ac8acb70ccf37bfd4e35efb28f1 (patch)
tree8917611732b33416e18356fd1f46d049d8e2cdd6 /spec/install/gemfile
parent32c01e4995385c2c17f35b4eec31464e27179648 (diff)
parent3cb89b7e5c0f39d4b481f9dc7b6c53b7bbe2e030 (diff)
downloadbundler-6ac096f829965ac8acb70ccf37bfd4e35efb28f1.tar.gz
Merge #6809
6809: Fix using gemspec & force_ruby_platform on windows r=deivid-rodriguez a=segiddins ### What was the end-user problem that led to this PR? The problem was using `gemspec` and `force_ruby_platform` on Windows would lead to gems not being requirable. Fixes #6801. ### What was your diagnosis of the problem? My diagnosis was there was a place where `force_ruby_platform` wasn't being taken into account, namely the query methods on `Bundler.current_ruby` ### What is your fix for the problem, implemented in this PR? My fix was to add a check for the local platform in `current_ruby`, so the `force_ruby_platform` override would be taken into account. ### Why did you choose this fix out of the possible options? I chose this fix because it avoids hard-coding knowledge of the setting in more places. Co-authored-by: Samuel Giddins <segiddins@segiddins.me> Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec/install/gemfile')
-rw-r--r--spec/install/gemfile/gemspec_spec.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb
index ecb8358ccc..c50f8c9668 100644
--- a/spec/install/gemfile/gemspec_spec.rb
+++ b/spec/install/gemfile/gemspec_spec.rb
@@ -331,24 +331,12 @@ RSpec.describe "bundle install from an existing gemspec" do
context "previously bundled for Ruby" do
let(:platform) { "ruby" }
- let(:explicit_platform) { false }
before do
build_lib("foo", :path => tmp.join("foo")) do |s|
s.add_dependency "rack", "=1.0.0"
end
- if explicit_platform
- create_file(
- tmp.join("foo", "foo-#{platform}.gemspec"),
- build_spec("foo", "1.0", platform) do
- dep "rack", "=1.0.0"
- @spec.authors = "authors"
- @spec.summary = "summary"
- end.first.to_ruby
- )
- end
-
gemfile <<-G
source "#{source_uri}"
gemspec :path => "../foo"
@@ -379,7 +367,17 @@ RSpec.describe "bundle install from an existing gemspec" do
context "using JRuby with explicit platform" do
let(:platform) { "java" }
- let(:explicit_platform) { true }
+
+ before do
+ create_file(
+ tmp.join("foo", "foo-#{platform}.gemspec"),
+ build_spec("foo", "1.0", platform) do
+ dep "rack", "=1.0.0"
+ @spec.authors = "authors"
+ @spec.summary = "summary"
+ end.first.to_ruby
+ )
+ end
it "should install" do
simulate_ruby_engine "jruby" do