summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2018-08-30 17:20:44 -0300
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2018-08-30 17:22:36 -0300
commita4c3c52433cc236deff997eee098ffd5b7f569af (patch)
treefa509517eaac2137e39c059b5c867175a22e42ad
parent4e215b74197581de3b11cf3e2948d604da7ca2d6 (diff)
downloadbundler-a4c3c52433cc236deff997eee098ffd5b7f569af.tar.gz
Remove extra new lines from `bundle env` output
-rw-r--r--lib/bundler/env.rb2
-rw-r--r--spec/bundler/env_spec.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index 923a14de0c..171b6520ad 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -88,7 +88,7 @@ module Bundler
def self.version_of(script)
return "not installed" unless Bundler.which(script)
- `#{script} --version`
+ `#{script} --version`.chomp
end
def self.chruby_version
diff --git a/spec/bundler/env_spec.rb b/spec/bundler/env_spec.rb
index 83c03e67d5..04de806235 100644
--- a/spec/bundler/env_spec.rb
+++ b/spec/bundler/env_spec.rb
@@ -139,5 +139,9 @@ RSpec.describe Bundler::Env do
expect(described_class.report).to include("Git 1.2.3 (Apple Git-BS)")
end
end
+
+ it "properly parses version of tools when shelling out to them" do
+ expect(described_class.send(:version_of, "ruby")).to_not include("\n")
+ end
end
end