Skip to content

Commit eb8f29c

Browse files
deivid-rodriguezmatzbot
authored andcommitted
[rubygems/rubygems] Fix test failure when running tests with ENV["EDITOR"] set
Can be reproduced, for example, with ``` bin/rspec spec/bundler/cli_spec.rb spec/other/cli_man_pages_spec.rb --order defined ``` ruby/rubygems@f57d199225
1 parent 8adc96b commit eb8f29c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/bundler/spec_helper.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
abort "The bundler specs cannot be run from a path that contains special characters (particularly #{$1.inspect})"
1010
end
1111

12+
# Bundler CLI will have different help text depending on whether this variable
13+
# is set, since the `-e` flag `bundle gem` with require an explicit value if
14+
# `EDITOR` is not set, but will use `EDITOR` by default is set. So make sure
15+
# it's `nil` before loading bundler to get a consistent help text, since some
16+
# tests rely on that.
17+
ENV["EDITOR"] = nil
1218
require "bundler"
19+
1320
require "rspec/core"
1421
require "rspec/expectations"
1522
require "rspec/mocks"
@@ -82,7 +89,6 @@ def self.ruby=(ruby)
8289
ENV["RUBYGEMS_GEMDEPS"] = nil
8390
ENV["XDG_CONFIG_HOME"] = nil
8491
ENV["GEMRC"] = nil
85-
ENV["EDITOR"] = nil
8692

8793
# Don't wrap output in tests
8894
ENV["THOR_COLUMNS"] = "10000"

0 commit comments

Comments
 (0)