summaryrefslogtreecommitdiff
path: root/spec/bundler/source
diff options
context:
space:
mode:
authorNick LaMuro <nicklamuro@gmail.com>2016-07-25 18:41:53 -0500
committerNick LaMuro <nicklamuro@gmail.com>2016-07-25 21:44:01 -0500
commit75f1f1757f6e169b3b6c3481f74e9033956c704b (patch)
treef89d4956fb825179578f7c513fcf1ef653ec68a3 /spec/bundler/source
parent1838c66f27b9668e278c7ee6ac7965a445b629cb (diff)
downloadbundler-75f1f1757f6e169b3b6c3481f74e9033956c704b.tar.gz
Add Bundler::Source::Git::GitProxy#full_version
Adds a full_version method that can be used to display the OS specific info. Useful when printing the environment information in the Bundler::Env
Diffstat (limited to 'spec/bundler/source')
-rw-r--r--spec/bundler/source/git/git_proxy_spec.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/bundler/source/git/git_proxy_spec.rb b/spec/bundler/source/git/git_proxy_spec.rb
index 5cd4e1843d..ce6b79b2b2 100644
--- a/spec/bundler/source/git/git_proxy_spec.rb
+++ b/spec/bundler/source/git/git_proxy_spec.rb
@@ -79,4 +79,39 @@ describe Bundler::Source::Git::GitProxy do
end
end
end
+
+ describe "#full_version" do
+ context "with a normal version number" do
+ before do
+ expect(subject).to receive(:git).with("--version").
+ and_return("git version 1.2.3")
+ end
+
+ it "returns the git version number" do
+ expect(subject.full_version).to eq("1.2.3")
+ end
+ end
+
+ context "with a OSX version number" do
+ before do
+ expect(subject).to receive(:git).with("--version").
+ and_return("git version 1.2.3 (Apple Git-BS)")
+ end
+
+ it "does not strip out OSX specific additions in the version string" do
+ expect(subject.full_version).to eq("1.2.3 (Apple Git-BS)")
+ end
+ end
+
+ context "with a msysgit version number" do
+ before do
+ expect(subject).to receive(:git).with("--version").
+ and_return("git version 1.2.3.msysgit.0")
+ end
+
+ it "does not strip out msysgit specific additions in the version string" do
+ expect(subject.full_version).to eq("1.2.3.msysgit.0")
+ end
+ end
+ end
end