diff options
author | Nick LaMuro <nicklamuro@gmail.com> | 2016-07-25 18:56:46 -0500 |
---|---|---|
committer | Nick LaMuro <nicklamuro@gmail.com> | 2016-07-25 21:44:02 -0500 |
commit | 06ab91386db8d493d512bd32b8fad9ca2b4c4b0f (patch) | |
tree | 47740092913d5115c16327ade722c6d7264effa2 | |
parent | 75f1f1757f6e169b3b6c3481f74e9033956c704b (diff) | |
download | bundler-06ab91386db8d493d512bd32b8fad9ca2b4c4b0f.tar.gz |
Use .full_version in Bundler::Env
-rw-r--r-- | lib/bundler/env.rb | 2 | ||||
-rw-r--r-- | spec/bundler/env_spec.rb | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb index 47e720a201..75edbf2b88 100644 --- a/lib/bundler/env.rb +++ b/lib/bundler/env.rb @@ -75,7 +75,7 @@ module Bundler end def git_version - Bundler::Source::Git::GitProxy.new(nil, nil, nil).version + Bundler::Source::Git::GitProxy.new(nil, nil, nil).full_version rescue Bundler::Source::Git::GitNotInstalledError "not installed" end diff --git a/spec/bundler/env_spec.rb b/spec/bundler/env_spec.rb index 305fcce351..73d1f1d7df 100644 --- a/spec/bundler/env_spec.rb +++ b/spec/bundler/env_spec.rb @@ -3,7 +3,8 @@ require "spec_helper" require "bundler/settings" describe Bundler::Env do - let(:env) { described_class.new } + let(:env) { described_class.new } + let(:git_proxy_stub) { Bundler::Source::Git::GitProxy.new(nil, nil, nil) } describe "#report" do it "prints the environment" do @@ -72,5 +73,15 @@ describe Bundler::Env do expect(output).to include(gemspec) end end + + context "when the git version is OS specific" do + it "includes OS specific information with the version number" do + expect(git_proxy_stub).to receive(:git).with("--version"). + and_return("git version 1.2.3 (Apple Git-BS)") + expect(Bundler::Source::Git::GitProxy).to receive(:new).and_return(git_proxy_stub) + + expect(env.report).to include("Git 1.2.3 (Apple Git-BS)") + end + end end end |