diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb index 35da1edfc7..92476be7d2 100644 --- a/lib/bundler/ui/shell.rb +++ b/lib/bundler/ui/shell.rb @@ -10,9 +10,7 @@ module Bundler attr_writer :shell def initialize(options = {}) - if options["no-color"] - Thor::Base.shell = Thor::Shell::Basic - end + Thor::Base.shell = options["no-color"] ? Thor::Shell::Basic : nil @shell = Thor::Base.shell.new @level = ENV["DEBUG"] ? "debug" : "info" @warning_history = [] 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