ruby-changes:61523
From: Frank <ko1@a...>
Date: Fri, 5 Jun 2020 07:33:56 +0900 (JST)
Subject: [ruby-changes:61523] 0d240de2f3 (master): [rubygems/rubygems] Tag test framework hint specs and use out helper
https://git.ruby-lang.org/ruby.git/commit/?id=0d240de2f3 From 0d240de2f32d877ca714ef6c0b51667367ec1498 Mon Sep 17 00:00:00 2001 From: Frank Lam <ryzingsun11@y...> Date: Sat, 23 May 2020 18:13:56 +0800 Subject: [rubygems/rubygems] Tag test framework hint specs and use out helper https://github.com/rubygems/rubygems/commit/1db61b5b5e diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 4b7a88b..0aec681 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -611,7 +611,7 @@ RSpec.describe "bundle gem" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/newgem_spec.rb#L611 it_behaves_like "test framework is present" end - context "gem.test set to rspec and --test with no arguments" do + context "gem.test set to rspec and --test with no arguments", :hint_text do before do bundle "config set gem.test rspec" bundle! "gem #{gem_name} --test" @@ -627,39 +627,42 @@ RSpec.describe "bundle gem" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/newgem_spec.rb#L627 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(last_command.stdout).to match(hint) + expect(out).to match(hint) end it_behaves_like "test framework is present" end - context "gem.test setting set to false and --test with no arguments" do + context "gem.test setting set to false and --test with no arguments", :hint_text do before do bundle "config set gem.test false" bundle! "gem #{gem_name} --test" end it "asks to generate test files" do - expect(last_command.stdout).to match("Do you want to generate tests with your gem?") + expect(out).to match("Do you want to generate tests with your gem?") end it "hints that the choice will only be applied to the current gem" do - hint = "Your choice will only be applied to this gem." - expect(last_command.stdout).to match(hint) + expect(out).to match("Your choice will only be applied to this gem.") end it_behaves_like "test framework is absent" end - context "gem.test setting not set and --test with no arguments" do + context "gem.test setting not set and --test with no arguments", :hint_text do before do bundle! "gem #{gem_name} --test" end + it "asks to generate test files" do + expect(out).to match("Do you want to generate tests with your gem?") + end + it "hints that the choice will be applied to future bundle gem calls" do hint = "Future `bundle gem` calls will use your choice. " \ "This setting can be changed anytime with `bundle config gem.test`." - expect(last_command.stdout).to match(hint) + expect(out).to match(hint) end it_behaves_like "test framework is absent" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/