summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJerome Dalbert <jerome.dalbert@gmail.com>2024-06-19 11:43:28 -0700
committergit <svn-admin@ruby-lang.org>2024-06-26 11:24:47 +0000
commitc6c817df28658bf1e8913373cbf1df0cf2c29f0d (patch)
treecc56e69861fbd3ef5bbf094d20370a644cf227af /spec
parent04c86a63cd749e221980a705e684c9d3cfb59d92 (diff)
[rubygems/rubygems] Add --no-test, --no-ci, and --no-linter options
https://github.com/rubygems/rubygems/commit/f58660ffcc
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/newgem_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb
index 9ff10158a4..78b83c8f8f 100644
--- a/spec/bundler/commands/newgem_spec.rb
+++ b/spec/bundler/commands/newgem_spec.rb
@@ -937,6 +937,15 @@ RSpec.describe "bundle gem" do
it_behaves_like "test framework is absent"
end
+ context "gem.test setting set to a test framework and --no-test" do
+ before do
+ bundle "config set gem.test rspec"
+ bundle "gem #{gem_name} --no-test"
+ end
+
+ it_behaves_like "test framework is absent"
+ end
+
context "--ci with no argument" do
it "does not generate any CI config" do
bundle "gem #{gem_name}"
@@ -1075,6 +1084,19 @@ RSpec.describe "bundle gem" do
end
end
+ context "gem.ci setting set to a CI service and --no-ci" do
+ before do
+ bundle "config set gem.ci github"
+ bundle "gem #{gem_name} --no-ci"
+ end
+
+ it "does not generate any CI config" do
+ expect(bundled_app("#{gem_name}/.github/workflows/main.yml")).to_not exist
+ expect(bundled_app("#{gem_name}/.gitlab-ci.yml")).to_not exist
+ expect(bundled_app("#{gem_name}/.circleci/config.yml")).to_not exist
+ end
+ end
+
context "--linter with no argument" do
it "does not generate any linter config" do
bundle "gem #{gem_name}"
@@ -1202,6 +1224,18 @@ RSpec.describe "bundle gem" do
end
end
+ context "gem.linter setting set to a linter and --no-linter" do
+ before do
+ bundle "config set gem.linter rubocop"
+ bundle "gem #{gem_name} --no-linter"
+ end
+
+ it "does not generate any linter config" do
+ expect(bundled_app("#{gem_name}/.rubocop.yml")).to_not exist
+ expect(bundled_app("#{gem_name}/.standard.yml")).to_not exist
+ end
+ end
+
context "--edit option" do
it "opens the generated gemspec in the user's text editor" do
output = bundle "gem #{gem_name} --edit=echo"