summaryrefslogtreecommitdiff
path: root/spec/bundler/settings_spec.rb
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-02-10 09:57:59 -0800
committerSamuel Giddins <segiddins@segiddins.me>2017-02-10 09:57:59 -0800
commit8cf7d8c488cc24334a0022cfc9b89fe95659ec52 (patch)
tree3341abfacaddfb5992904d7b0d026c604494c8f0 /spec/bundler/settings_spec.rb
parentef559704bb4a2b9163a5be8616634e3aea830a16 (diff)
downloadbundler-8cf7d8c488cc24334a0022cfc9b89fe95659ec52.tar.gz
[Settings] Allow not reading the global config file when there is no $HOME and $TMPDIR is not writableseg-read-only-fs-no-global-settings
Diffstat (limited to 'spec/bundler/settings_spec.rb')
-rw-r--r--spec/bundler/settings_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb
index c67ae81bac..020897882c 100644
--- a/spec/bundler/settings_spec.rb
+++ b/spec/bundler/settings_spec.rb
@@ -62,6 +62,19 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
end
end
+ describe "#global_config_file" do
+ context "when $HOME is not accessible" do
+ context "when $TMPDIR is not writable" do
+ it "does not raise" do
+ expect(Bundler.rubygems).to receive(:user_home).twice.and_return(nil)
+ expect(FileUtils).to receive(:mkpath).twice.with(File.join(Dir.tmpdir, "bundler", "home")).and_raise(Errno::EROFS, "Read-only file system @ dir_s_mkdir - /tmp/bundler")
+
+ expect(subject.send(:global_config_file)).to be_nil
+ end
+ end
+ end
+ end
+
describe "#[]" do
context "when the local config file is not found" do
subject(:settings) { described_class.new }