[rubygems/rubygems] Remove unnecessary nesting

eac831a1b7
This commit is contained in:
David Rodríguez 2025-07-02 18:21:25 +02:00 committed by Hiroshi SHIBATA
parent e7f11ecc2b
commit fab1323ab3

View file

@ -1504,11 +1504,6 @@ RSpec.describe "bundle gem" do
include_examples "generating a gem" include_examples "generating a gem"
context "testing --mit and --coc options against bundle config settings" do
let(:gem_name) { "test-gem" }
let(:require_path) { "test/gem" }
context "with mit option in bundle config settings set to true" do context "with mit option in bundle config settings set to true" do
before do before do
global_config "BUNDLE_GEM__MIT" => "true" global_config "BUNDLE_GEM__MIT" => "true"
@ -1605,9 +1600,7 @@ RSpec.describe "bundle gem" do
it_behaves_like "--changelog flag" it_behaves_like "--changelog flag"
it_behaves_like "--no-changelog flag" it_behaves_like "--no-changelog flag"
end end
end
context "testing --bundle option against git and bundle config settings" do
context "with bundle option in bundle config settings set to true" do context "with bundle option in bundle config settings set to true" do
before do before do
global_config "BUNDLE_GEM__BUNDLE" => "true" global_config "BUNDLE_GEM__BUNDLE" => "true"
@ -1633,9 +1626,7 @@ RSpec.describe "bundle gem" do
expect(out).to_not include("Running bundle install in the new gem directory.") expect(out).to_not include("Running bundle install in the new gem directory.")
end end
end end
end
context "testing --github-username option against git and bundle config settings" do
context "without git config set" do context "without git config set" do
before do before do
git("config --global --unset github.user") git("config --global --unset github.user")
@ -1647,6 +1638,8 @@ RSpec.describe "bundle gem" do
it_behaves_like "--github-username option", "gh_user" it_behaves_like "--github-username option", "gh_user"
end end
it_behaves_like "github_username configuration"
context "with github-username option in bundle config settings set to false" do context "with github-username option in bundle config settings set to false" do
before do before do
global_config "BUNDLE_GEM__GITHUB_USERNAME" => "false" global_config "BUNDLE_GEM__GITHUB_USERNAME" => "false"
@ -1663,6 +1656,8 @@ RSpec.describe "bundle gem" do
it_behaves_like "--github-username option", "gh_user" it_behaves_like "--github-username option", "gh_user"
end end
it_behaves_like "github_username configuration"
context "with github-username option in bundle config settings set to false" do context "with github-username option in bundle config settings set to false" do
before do before do
global_config "BUNDLE_GEM__GITHUB_USERNAME" => "false" global_config "BUNDLE_GEM__GITHUB_USERNAME" => "false"
@ -1670,21 +1665,6 @@ RSpec.describe "bundle gem" do
it_behaves_like "--github-username option", "gh_user" it_behaves_like "--github-username option", "gh_user"
end end
end end
end
context "testing github_username bundle config against git config settings" do
context "without git config set" do
before do
git("config --global --unset github.user")
end
it_behaves_like "github_username configuration"
end
context "with git config set" do
it_behaves_like "github_username configuration"
end
end
context "gem naming with underscore" do context "gem naming with underscore" do
let(:gem_name) { "test_gem" } let(:gem_name) { "test_gem" }