summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gemfile
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/install/gemfile')
-rw-r--r--spec/bundler/install/gemfile/gemspec_spec.rb19
-rw-r--r--spec/bundler/install/gemfile/git_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/groups_spec.rb20
-rw-r--r--spec/bundler/install/gemfile/path_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/sources_spec.rb44
5 files changed, 53 insertions, 34 deletions
diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb
index 4d3eaa37ca..d9469e5ca8 100644
--- a/spec/bundler/install/gemfile/gemspec_spec.rb
+++ b/spec/bundler/install/gemfile/gemspec_spec.rb
@@ -260,6 +260,25 @@ RSpec.describe "bundle install from an existing gemspec" do
expect(out).to eq("WIN")
end
+ it "does not make Gem.try_activate warn when local gem has extensions" do
+ build_lib("foo", path: tmp("foo")) do |s|
+ s.version = "1.0.0"
+ s.add_c_extension
+ end
+ build_repo2
+
+ install_gemfile <<-G
+ source "https://gem.repo2"
+ gemspec :path => '#{tmp("foo")}'
+ G
+
+ expect(the_bundle).to include_gems "foo 1.0.0"
+
+ run "Gem.try_activate('irb/lc/es/error.rb'); puts 'WIN'"
+ expect(out).to eq("WIN")
+ expect(err).to be_empty
+ end
+
it "handles downgrades" do
build_lib "omg", "2.0", path: lib_path("omg")
diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb
index 36751c46f2..5d6a0a648d 100644
--- a/spec/bundler/install/gemfile/git_spec.rb
+++ b/spec/bundler/install/gemfile/git_spec.rb
@@ -26,7 +26,7 @@ RSpec.describe "bundle install with git sources" do
expect(out).to eq("WIN")
end
- it "caches the git repo", bundler: "< 3" do
+ it "caches the git repo", bundler: "2" do
expect(Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"]).to have_attributes size: 1
end
diff --git a/spec/bundler/install/gemfile/groups_spec.rb b/spec/bundler/install/gemfile/groups_spec.rb
index f6f3edd01c..148b600088 100644
--- a/spec/bundler/install/gemfile/groups_spec.rb
+++ b/spec/bundler/install/gemfile/groups_spec.rb
@@ -100,7 +100,7 @@ RSpec.describe "bundle install with groups" do
expect(out).to include("Set for the current user (#{home(".bundle/config")}): [:emo]")
end
- it "allows running application where groups where configured by a different user", bundler: "< 3" do
+ it "allows running application where groups where configured by a different user", bundler: "2" do
bundle "config set without emo"
bundle :install
bundle "exec ruby -e 'puts 42'", env: { "BUNDLE_USER_HOME" => tmp("new_home").to_s }
@@ -113,7 +113,7 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).not_to include_gems "activesupport 2.3.5", groups: [:default]
end
- it "remembers previous exclusion with `--without`", bundler: "< 3" do
+ it "remembers previous exclusion with `--without`", bundler: "2" do
bundle "install --without emo"
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
bundle :install
@@ -159,14 +159,14 @@ RSpec.describe "bundle install with groups" do
ENV["BUNDLE_WITHOUT"] = nil
end
- it "clears --without when passed an empty list", bundler: "< 3" do
+ it "clears --without when passed an empty list", bundler: "2" do
bundle "install --without emo"
bundle "install --without ''"
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
- it "doesn't clear without when nothing is passed", bundler: "< 3" do
+ it "doesn't clear without when nothing is passed", bundler: "2" do
bundle "install --without emo"
bundle :install
@@ -184,7 +184,7 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).to include_gems "thin 1.0"
end
- it "installs gems from the previously requested group", bundler: "< 3" do
+ it "installs gems from the previously requested group", bundler: "2" do
bundle "install --with debugging"
expect(the_bundle).to include_gems "thin 1.0"
bundle :install
@@ -198,25 +198,25 @@ RSpec.describe "bundle install with groups" do
ENV["BUNDLE_WITH"] = nil
end
- it "clears --with when passed an empty list", bundler: "< 3" do
+ it "clears --with when passed an empty list", bundler: "2" do
bundle "install --with debugging"
bundle "install --with ''"
expect(the_bundle).not_to include_gems "thin 1.0"
end
- it "removes groups from without when passed at --with", bundler: "< 3" do
+ it "removes groups from without when passed at --with", bundler: "2" do
bundle "config set --local without emo"
bundle "install --with emo"
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
- it "removes groups from with when passed at --without", bundler: "< 3" do
+ it "removes groups from with when passed at --without", bundler: "2" do
bundle "config set --local with debugging"
bundle "install --without debugging", raise_on_error: false
expect(the_bundle).not_to include_gem "thin 1.0"
end
- it "errors out when passing a group to with and without via CLI flags", bundler: "< 3" do
+ it "errors out when passing a group to with and without via CLI flags", bundler: "2" do
bundle "install --with emo debugging --without emo", raise_on_error: false
expect(last_command).to be_failure
expect(err).to include("The offending groups are: emo")
@@ -235,7 +235,7 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).to include_gem "thin 1.0"
end
- it "can add and remove a group at the same time", bundler: "< 3" do
+ it "can add and remove a group at the same time", bundler: "2" do
bundle "install --with debugging --without emo"
expect(the_bundle).to include_gems "thin 1.0"
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb
index 7525404b24..669e63eb9c 100644
--- a/spec/bundler/install/gemfile/path_spec.rb
+++ b/spec/bundler/install/gemfile/path_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
RSpec.describe "bundle install with explicit source paths" do
- it "fetches gems with a global path source", bundler: "< 3" do
+ it "fetches gems with a global path source", bundler: "2" do
build_lib "foo"
install_gemfile <<-G
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb
index e1a5245800..e705a835d6 100644
--- a/spec/bundler/install/gemfile/sources_spec.rb
+++ b/spec/bundler/install/gemfile/sources_spec.rb
@@ -27,7 +27,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- it "refuses to install mismatched checksum because one gem has been tampered with", bundler: "< 3" do
+ it "refuses to install mismatched checksum because one gem has been tampered with", bundler: "2" do
lockfile <<~L
GEM
remote: https://gem.repo3/
@@ -71,7 +71,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle "config set --local disable_checksum_validation true"
end
- it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", bundler: "< 3" do
+ it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", bundler: "2" do
bundle :install, artifice: "compact_index"
expect(err).to include("Warning: the gem 'myrack' was found in multiple sources.")
@@ -79,7 +79,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(the_bundle).to include_gems("myrack-obama 1.0.0", "myrack 1.0.0", source: "remote1")
end
- it "does not use the full index unnecessarily", bundler: "< 3" do
+ it "does not use the full index unnecessarily", bundler: "2" do
bundle :install, artifice: "compact_index", verbose: true
expect(out).to include("https://gem.repo1/versions")
@@ -88,7 +88,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(out).not_to include("https://gem.repo3/quick/Marshal.4.8/")
end
- it "fails", bundler: "3" do
+ it "fails", bundler: "4" do
bundle :install, artifice: "compact_index", raise_on_error: false
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4)
@@ -108,14 +108,14 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- it "warns about ambiguous gems, but installs anyway", bundler: "< 3" do
+ it "warns about ambiguous gems, but installs anyway", bundler: "2" do
bundle :install, artifice: "compact_index"
expect(err).to include("Warning: the gem 'myrack' was found in multiple sources.")
expect(err).to include("Installed from: https://gem.repo1")
expect(the_bundle).to include_gems("myrack-obama 1.0.0", "myrack 1.0.0", source: "remote1")
end
- it "fails", bundler: "3" do
+ it "fails", bundler: "4" do
bundle :install, artifice: "compact_index", raise_on_error: false
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4)
@@ -145,7 +145,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- it "works in standalone mode", bundler: "< 3" do
+ it "works in standalone mode", bundler: "2" do
gem_checksum = checksum_digest(gem_repo4, "foo", "1.0")
bundle "install --standalone", artifice: "compact_index", env: { "BUNDLER_SPEC_FOO_CHECKSUM" => gem_checksum }
end
@@ -325,7 +325,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- it "fails when the two sources don't have the same checksum", bundler: "< 3" do
+ it "fails when the two sources don't have the same checksum", bundler: "2" do
bundle :install, artifice: "compact_index", raise_on_error: false
expect(err).to eq(<<~E.strip)
@@ -347,7 +347,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(exitstatus).to eq(37)
end
- it "fails when the two sources agree, but the local gem calculates a different checksum", bundler: "< 3" do
+ it "fails when the two sources agree, but the local gem calculates a different checksum", bundler: "2" do
myrack_checksum = "c0ffee11" * 8
bundle :install, artifice: "compact_index", env: { "BUNDLER_SPEC_MYRACK_CHECKSUM" => myrack_checksum }, raise_on_error: false
@@ -370,7 +370,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(exitstatus).to eq(37)
end
- it "installs from the other source and warns about ambiguous gems when the sources have the same checksum", bundler: "< 3" do
+ it "installs from the other source and warns about ambiguous gems when the sources have the same checksum", bundler: "2" do
gem_checksum = checksum_digest(gem_repo2, "myrack", "1.0.0")
bundle :install, artifice: "compact_index", env: { "BUNDLER_SPEC_MYRACK_CHECKSUM" => gem_checksum, "DEBUG" => "1" }
@@ -410,7 +410,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(lockfile).to eq(previous_lockfile)
end
- it "installs from the other source and warns about ambiguous gems when checksum validation is disabled", bundler: "< 3" do
+ it "installs from the other source and warns about ambiguous gems when checksum validation is disabled", bundler: "2" do
bundle "config set --local disable_checksum_validation true"
bundle :install, artifice: "compact_index"
@@ -450,7 +450,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(lockfile).to eq(previous_lockfile)
end
- it "fails", bundler: "3" do
+ it "fails", bundler: "4" do
bundle :install, artifice: "compact_index", raise_on_error: false
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4)
@@ -475,7 +475,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- it "installs the dependency from the pinned source without warning", bundler: "< 3" do
+ it "installs the dependency from the pinned source without warning", bundler: "2" do
bundle :install, artifice: "compact_index"
expect(err).not_to include("Warning: the gem 'myrack' was found in multiple sources.")
@@ -490,7 +490,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(the_bundle).to include_gems("depends_on_myrack 1.0.1", "myrack 1.0.0")
end
- it "fails", bundler: "3" do
+ it "fails", bundler: "4" do
bundle :install, artifice: "compact_index", raise_on_error: false
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4)
@@ -524,7 +524,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- context "when an indirect dependency can't be found in the aggregate rubygems source", bundler: "< 3" do
+ context "when an indirect dependency can't be found in the aggregate rubygems source", bundler: "2" do
before do
build_repo2
@@ -896,7 +896,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
L
end
- it "does not install newer versions or generate lockfile changes when running bundle install in frozen mode, and warns", bundler: "< 3" do
+ it "does not install newer versions or generate lockfile changes when running bundle install in frozen mode, and warns", bundler: "2" do
initial_lockfile = lockfile
bundle "config set --local frozen true"
@@ -914,7 +914,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(lockfile).to eq(initial_lockfile)
end
- it "fails when running bundle install in frozen mode", bundler: "3" do
+ it "fails when running bundle install in frozen mode", bundler: "4" do
initial_lockfile = lockfile
bundle "config set --local frozen true"
@@ -1264,7 +1264,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
lockfile aggregate_gem_section_lockfile
end
- it "installs the existing lockfile but prints a warning when checksum validation is disabled", bundler: "< 3" do
+ it "installs the existing lockfile but prints a warning when checksum validation is disabled", bundler: "2" do
bundle "config set --local deployment true"
bundle "config set --local disable_checksum_validation true"
@@ -1275,7 +1275,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(the_bundle).to include_gems("myrack 0.9.1", source: "remote3")
end
- it "prints a checksum warning when the checksums from both sources do not match", bundler: "< 3" do
+ it "prints a checksum warning when the checksums from both sources do not match", bundler: "2" do
bundle "config set --local deployment true"
bundle "install", artifice: "compact_index", raise_on_error: false
@@ -1302,7 +1302,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
E
end
- it "refuses to install the existing lockfile and prints an error", bundler: "3" do
+ it "refuses to install the existing lockfile and prints an error", bundler: "4" do
bundle "config set --local deployment true"
bundle "install", artifice: "compact_index", raise_on_error: false
@@ -1583,7 +1583,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(err).to include("Could not reach host gem.repo4. Check your network connection and try again.")
end
- context "when an indirect dependency is available from multiple ambiguous sources", bundler: "< 3" do
+ context "when an indirect dependency is available from multiple ambiguous sources", bundler: "2" do
it "succeeds but warns, suggesting a source block" do
build_repo4 do
build_gem "depends_on_myrack" do |s|
@@ -1614,7 +1614,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- context "when an indirect dependency is available from multiple ambiguous sources", bundler: "3" do
+ context "when an indirect dependency is available from multiple ambiguous sources", bundler: "4" do
it "raises, suggesting a source block" do
build_repo4 do
build_gem "depends_on_myrack" do |s|