2018-11-02 19:07:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec.describe "bundle update" do
|
|
|
|
context "with --gemfile" do
|
|
|
|
it "finds the gemfile" do
|
|
|
|
gemfile bundled_app("NotGemfile"), <<-G
|
2019-05-06 12:06:21 -04:00
|
|
|
source "#{file_uri_for(gem_repo1)}"
|
2018-11-02 19:07:56 -04:00
|
|
|
gem 'rack'
|
|
|
|
G
|
|
|
|
|
2020-06-03 14:45:36 -04:00
|
|
|
bundle :install, :gemfile => bundled_app("NotGemfile")
|
|
|
|
bundle :update, :gemfile => bundled_app("NotGemfile"), :all => true
|
2018-11-02 19:07:56 -04:00
|
|
|
|
|
|
|
# Specify BUNDLE_GEMFILE for `the_bundle`
|
|
|
|
# to retrieve the proper Gemfile
|
|
|
|
ENV["BUNDLE_GEMFILE"] = "NotGemfile"
|
|
|
|
expect(the_bundle).to include_gems "rack 1.0.0"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "with gemfile set via config" do
|
|
|
|
before do
|
|
|
|
gemfile bundled_app("NotGemfile"), <<-G
|
2019-05-06 12:06:21 -04:00
|
|
|
source "#{file_uri_for(gem_repo1)}"
|
2018-11-02 19:07:56 -04:00
|
|
|
gem 'rack'
|
|
|
|
G
|
|
|
|
|
2019-04-14 02:01:35 -04:00
|
|
|
bundle "config set --local gemfile #{bundled_app("NotGemfile")}"
|
2020-06-03 14:45:36 -04:00
|
|
|
bundle :install
|
2018-11-02 19:07:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "uses the gemfile to update" do
|
2020-06-03 14:45:36 -04:00
|
|
|
bundle "update", :all => true
|
2018-11-02 19:07:56 -04:00
|
|
|
bundle "list"
|
|
|
|
|
|
|
|
expect(out).to include("rack (1.0.0)")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "uses the gemfile while in a subdirectory" do
|
|
|
|
bundled_app("subdir").mkpath
|
2020-06-03 14:45:36 -04:00
|
|
|
bundle "update", :all => true, :dir => bundled_app("subdir")
|
2020-05-08 01:19:04 -04:00
|
|
|
bundle "list", :dir => bundled_app("subdir")
|
2018-11-02 19:07:56 -04:00
|
|
|
|
2020-05-08 01:19:04 -04:00
|
|
|
expect(out).to include("rack (1.0.0)")
|
2018-11-02 19:07:56 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|