summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/ui/silent.rb1
-rw-r--r--spec/bundler/source_spec.rb14
-rw-r--r--spec/support/helpers.rb1
3 files changed, 14 insertions, 2 deletions
diff --git a/lib/bundler/ui/silent.rb b/lib/bundler/ui/silent.rb
index 02978fc686..19ff7311c0 100644
--- a/lib/bundler/ui/silent.rb
+++ b/lib/bundler/ui/silent.rb
@@ -3,6 +3,7 @@ module Bundler
module UI
class Silent
def add_color(string, color)
+ string
end
def info(message, newline = nil)
diff --git a/spec/bundler/source_spec.rb b/spec/bundler/source_spec.rb
index fc28220c7d..25abd90c96 100644
--- a/spec/bundler/source_spec.rb
+++ b/spec/bundler/source_spec.rb
@@ -57,8 +57,18 @@ describe Bundler::Source do
context "with a different version" do
let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "< 1.5") }
- it "should return a string with the spec name and version and locked spec version" do
- expect(subject.version_message(spec)).to eq("nokogiri >= 1.6 (\e[32mwas < 1.5\e[0m)")
+ context "with color" do
+ before { Bundler.ui = Bundler::UI::Shell.new }
+
+ it "should return a string with the spec name and version and locked spec version" do
+ expect(subject.version_message(spec)).to eq("nokogiri >= 1.6 (\e[32mwas < 1.5\e[0m)")
+ end
+ end
+
+ context "without color" do
+ it "should return a string with the spec name and version and locked spec version" do
+ expect(subject.version_message(spec)).to eq("nokogiri >= 1.6 (was < 1.5)")
+ end
end
end
end
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 704e2140f5..d094727207 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -14,6 +14,7 @@ module Spec
FileUtils.mkdir_p(home)
ENV["BUNDLE_DISABLE_POSTIT"] = "1"
Bundler.send(:remove_instance_variable, :@settings) if Bundler.send(:instance_variable_defined?, :@settings)
+ Bundler.ui = nil
end
def self.bang(method)