summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Christian <brchristian@gmail.com>2017-03-28 17:15:51 -0700
committerBrian Christian <brchristian@gmail.com>2017-03-28 17:15:51 -0700
commit450e44521969d0fb3654c2b725a332ff39ab9165 (patch)
tree4fd91948586b4e06806b3b5da31a6b19f63f15b3
parent2429edee450aeb2822579ff926d7ce4013bc59ef (diff)
downloadbundler-450e44521969d0fb3654c2b725a332ff39ab9165.tar.gz
add tests
-rw-r--r--spec/bundler/source_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/bundler/source_spec.rb b/spec/bundler/source_spec.rb
index d35a6916a8..08d1698fcd 100644
--- a/spec/bundler/source_spec.rb
+++ b/spec/bundler/source_spec.rb
@@ -71,6 +71,32 @@ RSpec.describe Bundler::Source do
end
end
end
+
+ context "with a more recent version" do
+ let(:spec) { double(:spec, :name => "nokogiri", :version => "1.6.1", :platform => rb) }
+ let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") }
+
+ context "with color" do
+ before { Bundler.ui = Bundler::UI::Shell.new }
+
+ it "should return a string with the locked spec version in yellow" do
+ expect(subject.version_message(spec)).to eq("nokogiri 1.6.1\e[33m (was 1.7.0)\e[0m")
+ end
+ end
+ end
+
+ context "with an older version" do
+ let(:spec) { double(:spec, :name => "nokogiri", :version => "1.7.1", :platform => rb) }
+ let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") }
+
+ context "with color" do
+ before { Bundler.ui = Bundler::UI::Shell.new }
+
+ it "should return a string with the locked spec version in green" do
+ expect(subject.version_message(spec)).to eq("nokogiri 1.7.1\e[32m (was 1.7.0)\e[0m")
+ end
+ end
+ end
end
context "that do not contain the relevant gem spec" do