diff options
author | Frank Lam <ryzingsun11@yahoo.com> | 2020-06-03 04:09:47 +0800 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-06-18 19:14:15 +0900 |
commit | f6c8ca03595ba7e105e0e0d56e075babca70b5bd (patch) | |
tree | 58b2f5c7fb2d6d4c7a4815a933177f04b178370c | |
parent | 0ba2f3e8a9ceee6561c2aa2116b37aeddf891a3e (diff) | |
download | ruby-f6c8ca03595ba7e105e0e0d56e075babca70b5bd.tar.gz |
[rubygems/rubygems] Move already configured --test hint to before test file creation
https://github.com/rubygems/rubygems/commit/9e5f7a9099
-rw-r--r-- | lib/bundler/cli/gem.rb | 10 | ||||
-rw-r--r-- | spec/bundler/commands/newgem_spec.rb | 7 |
2 files changed, 6 insertions, 11 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index edbc6d6216..0cf1816c39 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -187,12 +187,6 @@ module Bundler Bundler.ui.info "Gem '#{name}' was successfully created. " \ "For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html" - - if options[:test] == Bundler.settings["gem.test"] - Bundler.ui.info "Bundler is configured to generate test files for #{Bundler.settings["gem.test"]}, "\ - "so -t is not needed if you want to continue using it. " \ - "This setting can be changed anytime with `bundle config gem.test`." - end rescue Errno::EEXIST => e raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.") end @@ -245,6 +239,10 @@ module Bundler Bundler.settings.set_global("gem.test", test_framework) end + if options[:test] == Bundler.settings["gem.test"] + Bundler.ui.info "#{options[:test]} is already configured, ignoring --test flag." + end + test_framework end diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 46f73179f3..0d787d1f0b 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -608,11 +608,8 @@ RSpec.describe "bundle gem" do expect(bundled_app("#{gem_name}/spec/spec_helper.rb")).to exist end - it "hints that --test is not needed" do - hint = "Bundler is configured to generate test files for rspec, "\ - "so -t is not needed if you want to continue using it. " \ - "This setting can be changed anytime with `bundle config gem.test`." - expect(out).to match(hint) + it "hints that --test is already configured" do + expect(out).to match("rspec is already configured, ignoring --test flag.") end end |