diff options
author | Bundlerbot <bot@bundler.io> | 2020-01-05 00:21:10 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2020-01-05 00:21:10 +0000 |
commit | c0b90706c8c417c374ea0f9283def0117d0c7549 (patch) | |
tree | 5bcaf1e6dca6a662206d1cfe475ee6249df2ffca | |
parent | b7a3eedd13088c037c291d935a4d715120a84dd1 (diff) | |
parent | 9291a99f9a16e1604e8a9e2990f3bdc3f920e451 (diff) | |
download | bundler-c0b90706c8c417c374ea0f9283def0117d0c7549.tar.gz |
Merge #7539
7539: Migrate Windows CI to Github Actions r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that current Windows CI is very slow.
### What is your fix for the problem, implemented in this PR?
My fix is to try migrate it to Github Actions to see if it gets better. It didn't really get much better, but I think Github Actions is better than Azure Pipelines.
Regarding the implementation, Github Actions environment doesn't seem to include an `rb-readline` version, and specs using `readline` just hang. My "solution" is to skip those specs for the time being.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | .azure-pipelines/patch_readline.sh | 3 | ||||
-rw-r--r-- | .azure-pipelines/rbreadline.diff | 41 | ||||
-rw-r--r-- | .azure-pipelines/steps.yml | 33 | ||||
-rw-r--r-- | .github/workflows/windows.yml | 34 | ||||
-rw-r--r-- | azure-pipelines.yml | 18 | ||||
-rw-r--r-- | spec/bundler/gem_helper_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/console_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/info_spec.rb | 22 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 82 | ||||
-rw-r--r-- | spec/commands/open_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 28 | ||||
-rw-r--r-- | spec/other/platform_spec.rb | 4 | ||||
-rw-r--r-- | spec/support/filters.rb | 1 | ||||
-rw-r--r-- | spec/support/helpers.rb | 4 |
14 files changed, 113 insertions, 165 deletions
diff --git a/.azure-pipelines/patch_readline.sh b/.azure-pipelines/patch_readline.sh deleted file mode 100644 index 69bf661a1b..0000000000 --- a/.azure-pipelines/patch_readline.sh +++ /dev/null @@ -1,3 +0,0 @@ -ruby_version=$(ruby -e 'puts RUBY_VERSION') - -git apply --ignore-space-change --ignore-whitespace '.azure-pipelines\rbreadline.diff' --directory="C:/hostedtoolcache/windows/Ruby/$ruby_version/x64/lib/ruby/site_ruby" --unsafe-paths diff --git a/.azure-pipelines/rbreadline.diff b/.azure-pipelines/rbreadline.diff deleted file mode 100644 index c139577610..0000000000 --- a/.azure-pipelines/rbreadline.diff +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/rbreadline.rb b/rbreadline.rb -index c710961..e35408c 100644 ---- a/rbreadline.rb -+++ b/rbreadline.rb -@@ -16,6 +16,7 @@ end - - module RbReadline - require 'etc' -+ require 'io/console' - - RL_LIBRARY_VERSION = "5.2" - RL_READLINE_VERSION = 0x0502 -@@ -1092,6 +1093,9 @@ module RbReadline - @current_readline_init_include_level = 0 - @current_readline_init_lineno = 0 - -+ # Used in windows -+ @is_pipe = false -+ - ENV["HOME"] ||= "#{ENV["HOMEDRIVE"]}#{ENV["HOMEPATH"]}" - if !File.directory? ENV["HOME"] - raise RuntimeError.new("HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory") -@@ -4490,6 +4494,10 @@ module RbReadline - end - - def rl_getc(stream) -+ # below added as test for whether we're connected to a pipe or a keyboard. -+ # Pipe connection is probably running under a test suite. -+ return (stream.getc || EOF rescue EOF) if @is_pipe -+ - while (@kbhit.Call == 0) - # If there is no input, yield the processor for other threads - sleep(@_keyboard_input_timeout) -@@ -4740,6 +4748,7 @@ module RbReadline - def readline_internal_charloop() - lastc = -1 - eof_found = false -+ @is_pipe = (!@rl_outstream.winsize rescue true) - - while (!@rl_done) - lk = @_rl_last_command_was_kill diff --git a/.azure-pipelines/steps.yml b/.azure-pipelines/steps.yml deleted file mode 100644 index 50e13fb499..0000000000 --- a/.azure-pipelines/steps.yml +++ /dev/null @@ -1,33 +0,0 @@ -steps: - -- task: UseRubyVersion@0 - inputs: - versionSpec: '= 2.6' - -- script: | - ruby -v - ridk version - displayName: 'ruby -v + ridk version' - -- script: | - bash .azure-pipelines\patch_readline.sh - displayName: 'patch local readline implementation (for https://github.com/bundler/bundler/issues/6907)' - -- script: | - ruby bin/rake spec:deps - displayName: 'ruby bin/rake spec:deps' - -- script: | - gem install --no-document --conservative rspec_junit_formatter - displayName: 'gem install rspec_junit_formatter' - -- script: | - ruby -r rspec_junit_formatter bin/rspec --format RspecJunitFormatter -o rspec/bundler-junit-results.xml || exit 0 - displayName: 'ruby bin/rspec' - -- task: PublishTestResults@2 - inputs: - testRunner: JUnit - testResultsFiles: rspec/bundler-junit-results.xml - displayName: Publish test results - condition: succeededOrFailed() diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..f1538cff97 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,34 @@ +name: windows + +on: + pull_request: + + push: + branches: + - staging + - trying + +jobs: + windows: + runs-on: windows-latest + + strategy: + matrix: + ruby: [ '2.4.x', '2.5.x', '2.6.x' ] + + steps: + - uses: actions/checkout@v1 + + - name: Setup ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + - name: Install dependencies + run: bin/rake spec:deps + shell: bash + + - name: Run specs + run: bin/rspec + shell: bash + continue-on-error: true diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 309e644487..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,18 +0,0 @@ -trigger: - branches: - include: - - master - - staging - - trying - - /.+-dev$/ - - /.+-stable$/ - -jobs: -- job: Windows - pool: - vmImage: 'vs2017-win2016' - variables: - rgv: v3.0.6 - steps: - - template: .azure-pipelines/steps.yml - timeoutInMinutes: 0 diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb index 29e10d64f8..b27c96b9a5 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Bundler::GemHelper do let(:app_gemspec_path) { app_path.join("#{app_name}.gemspec") } before(:each) do - global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false" + global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false", "BUNDLE_GEM__RUBOCOP" => "false" bundle "gem #{app_name}" prepare_gemspec(app_gemspec_path) end diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb index a0b71ff016..3092184f45 100644 --- a/spec/commands/console_spec.rb +++ b/spec/commands/console_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle console", :bundler => "< 3" do +RSpec.describe "bundle console", :bundler => "< 3", :readline => true do before :each do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" diff --git a/spec/commands/info_spec.rb b/spec/commands/info_spec.rb index 881f66d440..4feab54d4a 100644 --- a/spec/commands/info_spec.rb +++ b/spec/commands/info_spec.rb @@ -13,13 +13,13 @@ RSpec.describe "bundle info" do it "creates a Gemfile.lock when invoked with a gem name" do FileUtils.rm("Gemfile.lock") - bundle "info rails" + bundle! "info rails" expect(bundled_app("Gemfile.lock")).to exist end it "prints information if gem exists in bundle" do - bundle "info rails" + bundle! "info rails" expect(out).to include "* rails (2.3.2) \tSummary: This is just a fake gem for testing \tHomepage: http://example.com @@ -27,12 +27,12 @@ RSpec.describe "bundle info" do end it "prints path if gem exists in bundle" do - bundle "info rails --path" + bundle! "info rails --path" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end it "prints the path to the running bundler" do - bundle "info bundler --path" + bundle! "info bundler --path" expect(out).to eq(root.to_s) end @@ -43,7 +43,7 @@ RSpec.describe "bundle info" do context "given a default gem shippped in ruby", :ruby_repo do it "prints information about the default gem" do - bundle "info rdoc" + bundle! "info rdoc" expect(out).to include("* rdoc") expect(out).to include("Default Gem: yes") end @@ -51,7 +51,7 @@ RSpec.describe "bundle info" do context "given a gem with metadata" do it "prints the gem metadata" do - bundle "info has_metadata" + bundle! "info has_metadata" expect(out).to include "* has_metadata (1.0) \tSummary: This is just a fake gem for testing \tHomepage: http://example.com @@ -92,7 +92,7 @@ RSpec.describe "bundle info" do G expect(the_bundle).to include_gems "foo 1.0" - bundle "info foo" + bundle! "info foo" expect(out).to include("foo (1.0 #{@git.ref_for("master", 6)}") end @@ -107,7 +107,7 @@ RSpec.describe "bundle info" do G expect(the_bundle).to include_gems "foo 1.0.omg" - bundle "info foo" + bundle! "info foo" expect(out).to include("foo (1.0 #{@git.ref_for("omg", 6)}") end @@ -117,7 +117,7 @@ RSpec.describe "bundle info" do gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}" G - bundle "info foo" + bundle! "info foo" expect(out).to include("foo (1.0 #{sha[0..6]})") end @@ -134,14 +134,14 @@ RSpec.describe "bundle info" do end context "with a valid regexp for gem name" do - it "presents alternatives" do + it "presents alternatives", :readline do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack" gem "rack-obama" G - bundle "info rac" + bundle! "info rac" expect(out).to eq "1 : rack\n2 : rack-obama\n0 : - exit -\n>" end end diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 2c8ab4b5ef..7cad5c04a4 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -17,7 +17,6 @@ RSpec.describe "bundle gem" do let(:require_path) { "mygem" } before do - global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false" git_config_content = <<-EOF [user] name = "Bundler User" @@ -64,7 +63,7 @@ RSpec.describe "bundle gem" do bundle! "gem #{gem_name} #{flags}" end - it "generates a gem skeleton with a .git folder" do + it "generates a gem skeleton with a .git folder", :readline do gem_skeleton_assertions expect(bundled_app("#{gem_name}/.git")).to exist end @@ -82,7 +81,7 @@ RSpec.describe "bundle gem" do end end - context "when passing --no-git" do + context "when passing --no-git", :readline do before do bundle! "gem #{gem_name} --no-git" end @@ -197,7 +196,7 @@ RSpec.describe "bundle gem" do end end - context "README.md" do + context "README.md", :readline do context "git config github.user present" do before do bundle! "gem #{gem_name}" @@ -212,7 +211,7 @@ RSpec.describe "bundle gem" do context "git config github.user is absent" do before do sys_exec("git config --unset github.user") - bundle "gem #{gem_name}" + bundle! "gem #{gem_name}" end it "contribute URL set to [USERNAME]" do @@ -222,18 +221,18 @@ RSpec.describe "bundle gem" do end end - it "creates a new git repository" do - bundle "gem #{gem_name}" + it "creates a new git repository", :readline do + bundle! "gem #{gem_name}" expect(bundled_app("#{gem_name}/.git")).to exist end - context "when git is not available" do + context "when git is not available", :readline do # This spec cannot have `git` available in the test env before do load_paths = [lib_dir, spec_dir] load_path_str = "-I#{load_paths.join(File::PATH_SEPARATOR)}" - sys_exec "#{Gem.ruby} #{load_path_str} #{bindir.join("bundle")} gem #{gem_name}", "PATH" => "" + sys_exec! "#{Gem.ruby} #{load_path_str} #{bindir.join("bundle")} gem #{gem_name}", "PATH" => "" end it "creates the gem without the need for git" do @@ -249,7 +248,7 @@ RSpec.describe "bundle gem" do end end - it "generates a valid gemspec" do + it "generates a valid gemspec", :readline do bundle! "gem newgem --bin" prepare_gemspec(bundled_app("newgem", "newgem.gemspec")) @@ -263,11 +262,11 @@ RSpec.describe "bundle gem" do expect(last_command.stdboth).not_to include("ERROR") end - context "gem naming with relative paths" do + context "gem naming with relative paths", :readline do it "resolves ." do create_temporary_dir("tmp") - bundle "gem ." + bundle! "gem ." expect(bundled_app("tmp/lib/tmp.rb")).to exist end @@ -275,7 +274,7 @@ RSpec.describe "bundle gem" do it "resolves .." do create_temporary_dir("temp/empty_dir") - bundle "gem .." + bundle! "gem .." expect(bundled_app("temp/lib/temp.rb")).to exist end @@ -283,7 +282,7 @@ RSpec.describe "bundle gem" do it "resolves relative directory" do create_temporary_dir("tmp/empty/tmp") - bundle "gem ../../empty" + bundle! "gem ../../empty" expect(bundled_app("tmp/empty/lib/empty.rb")).to exist end @@ -329,7 +328,7 @@ RSpec.describe "bundle gem" do before do `git config --unset user.name` `git config --unset user.email` - bundle "gem #{gem_name}" + bundle! "gem #{gem_name}" end it_should_behave_like "git config is absent" @@ -384,7 +383,7 @@ RSpec.describe "bundle gem" do context "--exe parameter set" do before do - bundle "gem #{gem_name} --exe" + bundle! "gem #{gem_name} --exe" end it "builds exe skeleton" do @@ -398,7 +397,7 @@ RSpec.describe "bundle gem" do context "--bin parameter set" do before do - bundle "gem #{gem_name} --bin" + bundle! "gem #{gem_name} --bin" end it "builds exe skeleton" do @@ -412,7 +411,7 @@ RSpec.describe "bundle gem" do context "no --test parameter" do before do - bundle "gem #{gem_name}" + bundle! "gem #{gem_name}" end it "doesn't create any spec/test file" do @@ -426,7 +425,7 @@ RSpec.describe "bundle gem" do context "--test parameter set to rspec" do before do - bundle "gem #{gem_name} --test=rspec" + bundle! "gem #{gem_name} --test=rspec" end it "builds spec skeleton" do @@ -457,7 +456,7 @@ RSpec.describe "bundle gem" do context "gem.test setting set to rspec" do before do bundle "config set gem.test rspec" - bundle "gem #{gem_name}" + bundle! "gem #{gem_name}" end it "builds spec skeleton" do @@ -470,7 +469,7 @@ RSpec.describe "bundle gem" do context "gem.test setting set to rspec and --test is set to minitest" do before do bundle "config set gem.test rspec" - bundle "gem #{gem_name} --test=minitest" + bundle! "gem #{gem_name} --test=minitest" end it "builds spec skeleton" do @@ -515,7 +514,7 @@ RSpec.describe "bundle gem" do context "gem.test setting set to minitest" do before do bundle "config set gem.test minitest" - bundle "gem #{gem_name}" + bundle! "gem #{gem_name}" end it "creates a default rake task to run the test suite" do @@ -538,7 +537,7 @@ RSpec.describe "bundle gem" do context "--test with no arguments" do before do - bundle "gem #{gem_name} --test" + bundle! "gem #{gem_name} --test" end it "defaults to rspec" do @@ -560,52 +559,61 @@ RSpec.describe "bundle gem" do end end - context "testing --mit and --coc options against bundle config settings" do + context "testing --mit and --coc options against bundle config settings", :readline do let(:gem_name) { "test-gem" } let(:require_path) { "test/gem" } context "with mit option in bundle config settings set to true" do before do - global_config "BUNDLE_GEM__MIT" => "true", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__RUBOCOP" => "false", "BUNDLE_GEM__COC" => "false" + global_config "BUNDLE_GEM__MIT" => "true" end it_behaves_like "--mit flag" it_behaves_like "--no-mit flag" end context "with mit option in bundle config settings set to false" do + before do + global_config "BUNDLE_GEM__MIT" => "false" + end it_behaves_like "--mit flag" it_behaves_like "--no-mit flag" end context "with coc option in bundle config settings set to true" do before do - global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__RUBOCOP" => "false", "BUNDLE_GEM__COC" => "true" + global_config "BUNDLE_GEM__COC" => "true" end it_behaves_like "--coc flag" it_behaves_like "--no-coc flag" end context "with coc option in bundle config settings set to false" do + before do + global_config "BUNDLE_GEM__COC" => "false" + end it_behaves_like "--coc flag" it_behaves_like "--no-coc flag" end context "with rubocop option in bundle config settings set to true" do before do - global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false", "BUNDLE_GEM__RUBOCOP" => "true" + global_config "BUNDLE_GEM__RUBOCOP" => "true" end it_behaves_like "--rubocop flag" it_behaves_like "--no-rubocop flag" end context "with rubocop option in bundle config settings set to false" do + before do + global_config "BUNDLE_GEM__RUBOCOP" => "false" + end it_behaves_like "--rubocop flag" it_behaves_like "--no-rubocop flag" end end - context "gem naming with underscore" do + context "gem naming with underscore", :readline do let(:gem_name) { "test_gem" } let(:require_path) { "test_gem" } @@ -655,7 +663,7 @@ RSpec.describe "bundle gem" do end end - context "gem naming with dashed" do + context "gem naming with dashed", :readline do let(:gem_name) { "test-gem" } let(:require_path) { "test/gem" } @@ -673,7 +681,7 @@ RSpec.describe "bundle gem" do end describe "uncommon gem names" do - it "can deal with two dashes" do + it "can deal with two dashes", :readline do bundle! "gem a--a" expect(bundled_app("a--a/a--a.gemspec")).to exist @@ -703,7 +711,7 @@ Usage: "bundle gem NAME [OPTIONS]" end end - describe "#ensure_safe_gem_name" do + describe "#ensure_safe_gem_name", :readline do before do bundle "gem #{subject}" end @@ -729,11 +737,11 @@ Usage: "bundle gem NAME [OPTIONS]" end end - context "on first run" do + context "on first run", :readline do it "asks about test framework" do global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__COC" => "false" - bundle "gem foobar" do |input, _, _| + bundle! "gem foobar" do |input, _, _| input.puts "rspec" end @@ -756,7 +764,7 @@ Usage: "bundle gem NAME [OPTIONS]" bundle "config list" - bundle "gem foobar" do |input, _, _| + bundle! "gem foobar" do |input, _, _| input.puts "yes" end @@ -766,7 +774,7 @@ Usage: "bundle gem NAME [OPTIONS]" it "asks about CoC" do global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false" - bundle "gem foobar" do |input, _, _| + bundle! "gem foobar" do |input, _, _| input.puts "yes" end @@ -774,7 +782,7 @@ Usage: "bundle gem NAME [OPTIONS]" end end - context "on conflicts with a previously created file" do + context "on conflicts with a previously created file", :readline do it "should fail gracefully" do FileUtils.touch("conflict-foobar") bundle "gem conflict-foobar" @@ -783,7 +791,7 @@ Usage: "bundle gem NAME [OPTIONS]" end end - context "on conflicts with a previously created directory" do + context "on conflicts with a previously created directory", :readline do it "should succeed" do FileUtils.mkdir_p("conflict-foobar/Gemfile") bundle! "gem conflict-foobar" diff --git a/spec/commands/open_spec.rb b/spec/commands/open_spec.rb index 8fae4af5b4..31dc0315ac 100644 --- a/spec/commands/open_spec.rb +++ b/spec/commands/open_spec.rb @@ -58,7 +58,7 @@ RSpec.describe "bundle open" do expect(out).to include("bundler_editor #{default_bundle_path("gems", "activerecord-2.3.2")}") end - it "select the gem from many match gems" do + it "select the gem from many match gems", :readline do env = { "EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor" } bundle "open active", :env => env do |input, _, _| input.puts "2" @@ -67,7 +67,7 @@ RSpec.describe "bundle open" do expect(out).to match(/bundler_editor #{default_bundle_path('gems', 'activerecord-2.3.2')}\z/) end - it "allows selecting exit from many match gems" do + it "allows selecting exit from many match gems", :readline do env = { "EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor" } bundle! "open active", :env => env do |input, _, _| input.puts "0" diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 61b8f73e7f..823a806f3e 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -12,7 +12,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do it "creates a Gemfile.lock if one did not exist" do FileUtils.rm("Gemfile.lock") - bundle "show" + bundle! "show" expect(bundled_app("Gemfile.lock")).to exist end @@ -20,18 +20,18 @@ RSpec.describe "bundle show", :bundler => "< 3" do it "creates a Gemfile.lock when invoked with a gem name" do FileUtils.rm("Gemfile.lock") - bundle "show rails" + bundle! "show rails" expect(bundled_app("Gemfile.lock")).to exist end it "prints path if gem exists in bundle" do - bundle "show rails" + bundle! "show rails" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end it "prints path if gem exists in bundle (with --paths option)" do - bundle "show rails --paths" + bundle! "show rails --paths" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end @@ -45,7 +45,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints the path to the running bundler" do - bundle "show bundler" + bundle! "show bundler" expect(out).to eq(root.to_s) end @@ -55,7 +55,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints path of all gems in bundle sorted by name" do - bundle "show --paths" + bundle! "show --paths" expect(out).to include(default_bundle_path("gems", "rake-12.3.2").to_s) expect(out).to include(default_bundle_path("gems", "rails-2.3.2").to_s) @@ -66,7 +66,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints summary of gems" do - bundle "show --verbose" + bundle! "show --verbose" expect(out).to include <<~MSG * actionmailer (2.3.2) @@ -77,7 +77,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "includes bundler in the summary of gems" do - bundle "show --verbose" + bundle! "show --verbose" expect(out).to include <<~MSG * bundler (#{Bundler::VERSION}) @@ -99,7 +99,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do G expect(the_bundle).to include_gems "foo 1.0" - bundle :show + bundle! :show expect(out).to include("foo (1.0 #{@git.ref_for("master", 6)}") end @@ -114,7 +114,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do G expect(the_bundle).to include_gems "foo 1.0.omg" - bundle :show + bundle! :show expect(out).to include("foo (1.0 #{@git.ref_for("omg", 6)}") end @@ -124,7 +124,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}" G - bundle :show + bundle! :show expect(out).to include("foo (1.0 #{sha[0..6]})") end @@ -161,19 +161,19 @@ RSpec.describe "bundle show", :bundler => "< 3" do G bundle "config set auto_install 1" - bundle :show + bundle! :show expect(out).to include("Installing foo 1.0") end context "with a valid regexp for gem name" do - it "presents alternatives" do + it "presents alternatives", :readline do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack" gem "rack-obama" G - bundle "show rac" + bundle! "show rac" expect(out).to eq "1 : rack\n2 : rack-obama\n0 : - exit -\n>" end end diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index ab9ba9cae6..da35c6a0af 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -936,7 +936,7 @@ G G end - it "starts IRB with the default group loaded when ruby version matches" do + it "starts IRB with the default group loaded when ruby version matches", :readline do gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack" @@ -953,7 +953,7 @@ G expect(out).to include("0.9.1") end - it "starts IRB with the default group loaded when ruby version matches any engine" do + it "starts IRB with the default group loaded when ruby version matches any engine", :readline do simulate_ruby_engine "jruby" do gemfile <<-G source "#{file_uri_for(gem_repo1)}" diff --git a/spec/support/filters.rb b/spec/support/filters.rb index 564bdece13..229c79d7c1 100644 --- a/spec/support/filters.rb +++ b/spec/support/filters.rb @@ -41,6 +41,7 @@ RSpec.configure do |config| config.filter_run_excluding :ruby_repo => !ENV["GEM_COMMAND"].nil? config.filter_run_excluding :no_color_tty => Gem.win_platform? || !ENV["GITHUB_ACTION"].nil? config.filter_run_excluding :permissions => Gem.win_platform? + config.filter_run_excluding :readline => Gem.win_platform? config.filter_run_when_matching :focus unless ENV["CI"] end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index e9c9e766cf..674a31a780 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -92,7 +92,7 @@ module Spec run(cmd, *args) end - def bundle(cmd, options = {}) + def bundle(cmd, options = {}, &block) with_sudo = options.delete(:sudo) sudo = with_sudo == :preserve_env ? "sudo -E" : "sudo" if with_sudo @@ -140,7 +140,7 @@ module Spec end.join cmd = "#{sudo} #{Gem.ruby} #{load_path_str} #{requires_str} #{bundle_bin} #{cmd}#{args}" - sys_exec(cmd, env) {|i, o, thr| yield i, o, thr if block_given? } + sys_exec(cmd, env, &block) end bang :bundle |