1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Remove gemfile_should_be helper as well

https://github.com/rubygems/rubygems/commit/79f3c00caa
This commit is contained in:
David Rodríguez 2021-11-11 20:28:47 +01:00 committed by git
parent 1f91009d24
commit 4736dec58b
2 changed files with 25 additions and 29 deletions

View file

@ -41,7 +41,7 @@ RSpec.describe "bundle remove" do
expect(out).to include("rack was removed.")
expect(the_bundle).to_not include_gems "rack"
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -61,7 +61,7 @@ RSpec.describe "bundle remove" do
bundle "remove rack"
expect(out).to include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source '#{file_uri_for(gem_repo1)}'
gem 'git'
@ -98,7 +98,7 @@ RSpec.describe "bundle remove" do
expect(out).to include("rack was removed.")
expect(out).to include("rails was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -117,7 +117,7 @@ RSpec.describe "bundle remove" do
bundle "remove rails rack minitest", :raise_on_error => false
expect(err).to include("`rack` is not specified in #{bundled_app_gemfile} so it could not be removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
gem "rails"
@ -139,7 +139,7 @@ RSpec.describe "bundle remove" do
bundle "remove rack"
expect(out).to include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -159,7 +159,7 @@ RSpec.describe "bundle remove" do
bundle "remove rspec"
expect(out).to include("rspec was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -179,7 +179,7 @@ RSpec.describe "bundle remove" do
bundle "remove rack"
expect(out).to include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
group :test do
@ -205,7 +205,7 @@ RSpec.describe "bundle remove" do
bundle "remove rspec"
expect(out).to include("rspec was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -224,7 +224,7 @@ RSpec.describe "bundle remove" do
bundle "remove rspec"
expect(out).to include("rspec was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -247,7 +247,7 @@ RSpec.describe "bundle remove" do
bundle "remove rspec"
expect(out).to include("rspec was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -270,7 +270,7 @@ RSpec.describe "bundle remove" do
bundle "remove rspec"
expect(out).to include("rspec was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -293,7 +293,7 @@ RSpec.describe "bundle remove" do
bundle "remove rspec"
expect(out).to include("rspec was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
group :test do
@ -320,7 +320,7 @@ RSpec.describe "bundle remove" do
bundle "remove rspec"
expect(out).to include("rspec was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
group :test do
@ -344,7 +344,7 @@ RSpec.describe "bundle remove" do
bundle "remove rails", :raise_on_error => false
expect(err).to include("Gems could not be removed. rack (>= 0) would also have been removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
gem "rack"; gem "rails"
G
@ -366,7 +366,7 @@ RSpec.describe "bundle remove" do
expect(out).to include("rails was removed.")
expect(out).to include("minitest was removed.")
expect(out).to include("rack, rspec could not be removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
gem"rack"
gem"rspec"
@ -398,7 +398,7 @@ RSpec.describe "bundle remove" do
bundle "remove rspec"
expect(out).to include("rspec was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
gem "rack"
@ -482,7 +482,7 @@ RSpec.describe "bundle remove" do
expect(out).to include("rack was removed.")
expect(err).to include("`rack` is not specified in #{bundled_app("Gemfile-other")} so it could not be removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
eval_gemfile "Gemfile-other"
@ -507,7 +507,7 @@ RSpec.describe "bundle remove" do
expect(out).to include("rack was removed.")
expect(err).to include("Gems could not be removed. rails (>= 0) would also have been removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
eval_gemfile "Gemfile-other"
@ -532,7 +532,7 @@ RSpec.describe "bundle remove" do
expect(err).to include("Gems could not be removed. rails (>= 0) would also have been removed.")
expect(bundled_app("Gemfile-other").read).to include("gem \"rack\"")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
eval_gemfile "Gemfile-other"
@ -575,7 +575,7 @@ RSpec.describe "bundle remove" do
bundle "remove rack"
expect(out).to include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -594,7 +594,7 @@ RSpec.describe "bundle remove" do
bundle "remove rack"
expect(out).to include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -631,7 +631,7 @@ RSpec.describe "bundle remove" do
bundle "remove rack"
expect(out).to include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
# gem "rack" might be used in the future
@ -650,7 +650,7 @@ RSpec.describe "bundle remove" do
bundle "remove rack"
expect(out).to include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
G
end
@ -669,7 +669,7 @@ RSpec.describe "bundle remove" do
expect(out).to_not include("puma was removed.")
expect(out).to include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
gem "puma" # implements interface provided by gem "rack"
G
@ -689,7 +689,7 @@ RSpec.describe "bundle remove" do
expect(out).to include("puma was removed.")
expect(out).to_not include("rack was removed.")
gemfile_should_be <<-G
expect(gemfile).to eq <<~G
source "#{file_uri_for(gem_repo1)}"
gem "rack"

View file

@ -221,9 +221,5 @@ module Spec
expect(Bundler::Plugin).not_to be_installed(name)
end
end
def gemfile_should_be(expected)
expect(bundled_app_gemfile).to read_as(strip_whitespace(expected))
end
end
end