summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-06-16 23:10:46 -0400
committerSamuel Giddins <segiddins@segiddins.me>2017-06-16 23:10:46 -0400
commitbf5bf106230772934602768bb31a68dc925691f0 (patch)
tree8bd5a9643fdd0acced0c5665d31244847287a238
parentbe637c55ecae0032d506151364b62c08958e075d (diff)
downloadbundler-seg-fix-manpath.tar.gz
[EnvironmentPreserver] Allow preserving MANPATHseg-fix-manpath
-rw-r--r--lib/bundler/environment_preserver.rb1
-rw-r--r--spec/runtime/setup_spec.rb38
2 files changed, 39 insertions, 0 deletions
diff --git a/lib/bundler/environment_preserver.rb b/lib/bundler/environment_preserver.rb
index 9a254bdd05..f78872442a 100644
--- a/lib/bundler/environment_preserver.rb
+++ b/lib/bundler/environment_preserver.rb
@@ -9,6 +9,7 @@ module Bundler
BUNDLER_VERSION
GEM_HOME
GEM_PATH
+ MANPATH
PATH
RUBYLIB
RUBYOPT
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index 8418f63c3b..909378ab02 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -740,6 +740,44 @@ end
expect(err).to lack_errors
end
+ describe "$MANPATH" do
+ before do
+ build_repo4 do
+ build_gem "with_man" do |s|
+ s.write("man/man1/page.1", "MANPAGE")
+ end
+ end
+ end
+
+ context "when the user has one set" do
+ before { ENV["MANPATH"] = "/foo:" }
+
+ it "adds the gem's man dir to the MANPATH" do
+ install_gemfile! <<-G
+ source "file:#{gem_repo4}"
+ gem "with_man"
+ G
+
+ run! "puts ENV['MANPATH']"
+ expect(out).to eq("#{system_gem_path("gems/with_man-1.0/man")}:/foo")
+ end
+ end
+
+ context "when the user does not have one set" do
+ before { ENV.delete("MANPATH") }
+
+ it "adds the gem's man dir to the MANPATH" do
+ install_gemfile! <<-G
+ source "file:#{gem_repo4}"
+ gem "with_man"
+ G
+
+ run! "puts ENV['MANPATH']"
+ expect(out).to eq(system_gem_path("gems/with_man-1.0/man").to_s)
+ end
+ end
+ end
+
it "should prepend gemspec require paths to $LOAD_PATH in order" do
update_repo2 do
build_gem("requirepaths") do |s|