-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Conversation
This needs test coverage |
@segiddins I'll be honest - I have no idea where to add the coverage for that. It seems like #4951 broke it, but I don't see where that added/changed any coverage around this break to give me an idea of where to add it. Are you able to give me some guidance on it? |
You could write a unit test in |
☔ The latest upstream changes (presumably #5363) made this pull request unmergeable. Please resolve the merge conflicts. |
6488e05
to
212be05
Compare
@segiddins I'm trying to help @jlambert121 with a test and it's proving incredibly difficult. The line of code being changed has no test coverage at all. I tried to write the following test to cover the feature as implemented on master: # in spec/bundler/bundler_spec.rb
it "should blow up if it can't make a homedir" do
allow(Dir).to receive(:tmpdir).and_return("/TMP")
allow(FileTest).to receive(:exist?).with("/TMP/bundler/home").and_return(false)
expect(FileUtils).to receive(:mkpath).once.ordered.with("/TMP/bundler/home")
expect(FileUtils).to receive(:mkpath).once.ordered.with("/TMP/bundler/home/USER").and_raise(Errno::EACCES)
expect {
Bundler.tmp_home_path("USER", "")
}.to raise_error("OH NOES")
end This copies the existing spec https://github.com/bundler/bundler/blob/master/spec/bundler/bundler_spec.rb#L203 and mocks the Then I get this:
Nothing is Is this something obvious that I can fix? Or can you try adding the test above and seeing what happens for you? (full stack below)
|
rspec requires it to show a diff when tests fail |
any ideas on how I can get it to successfully require? If I put |
Have you run |
ok, that worked. thanks! |
I actually have a fix for this that is more along the lines of what I was thinking in #5371 (comment) -- just allow skipping reading the global config when creating that temporary directory fails |
Please have a look at #5421 |
☔ The latest upstream changes (presumably #5421) made this pull request unmergeable. Please resolve the merge conflicts. |
Resolves the issue where bundler errors on startup on a read only filesystem.
Resolves #5371