diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-05-24 20:28:25 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-03 09:29:55 +0900 |
commit | 580e165873c727b9248e1ba7d3ac0af9b121a235 (patch) | |
tree | 58675d7d45efbb51cb9305d09916972f261e7edd /spec | |
parent | b95756c7a998311a2d4bbee94530c6ad83ab7d06 (diff) |
[bundler/bundler] Respect color option when instantiating shells
Thor's base shell will be memoized the first time it is set. So if we
instantiate a no-color shell first, further instantiations of a bundler
shell will be initialized with a no-color shell by default. This is
caused some sources specs to fail, depending on the order they run.
See for example https://travis-ci.org/bundler/bundler/builds/500328994.
What we do to fix it is to reset the shell unless no-color is explicitly
specified. That way, further instantiations will rerun thor's internal
logic to choose the default shell.
https://github.com/bundler/bundler/commit/786b5d9894
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/bundler/source_spec.rb | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/spec/bundler/bundler/source_spec.rb b/spec/bundler/bundler/source_spec.rb index d70fd7e549..9ef8e7e50f 100644 --- a/spec/bundler/bundler/source_spec.rb +++ b/spec/bundler/bundler/source_spec.rb @@ -60,10 +60,6 @@ RSpec.describe Bundler::Source do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the spec name and version and locked spec version" do - if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) - skip "tty color is not supported with Thor::Shell::Basic environment." - end - expect(subject.version_message(spec)).to eq("nokogiri >= 1.6\e[32m (was < 1.5)\e[0m") end end @@ -83,10 +79,6 @@ RSpec.describe Bundler::Source do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the locked spec version in yellow" do - if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) - skip "tty color is not supported with Thor::Shell::Basic environment." - end - expect(subject.version_message(spec)).to eq("nokogiri 1.6.1\e[33m (was 1.7.0)\e[0m") end end @@ -100,10 +92,6 @@ RSpec.describe Bundler::Source do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the locked spec version in green" do - if Bundler.ui.instance_variable_get(:@shell).is_a?(Bundler::Thor::Shell::Basic) - skip "tty color is not supported with Thor::Shell::Basic environment." - end - expect(subject.version_message(spec)).to eq("nokogiri 1.7.1\e[32m (was 1.7.0)\e[0m") end end |