We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9aeec87 + db61de6 commit dd5d15fCopy full SHA for dd5d15f
2 files changed
bundler/lib/bundler/ruby_dsl.rb
@@ -57,6 +57,8 @@ def normalize_ruby_file(filename)
57
else
58
file_content.strip
59
end
60
+ rescue Errno::ENOENT
61
+ raise GemfileError, "Could not find version file #{filename}"
62
63
64
bundler/spec/bundler/ruby_dsl_spec.rb
@@ -210,6 +210,16 @@ class MockDSL
210
it_behaves_like "it stores the ruby version"
211
212
213
+
214
+ context "when the file does not exist" do
215
+ let(:ruby_version_file_path) { nil }
216
+ let(:ruby_version_arg) { nil }
217
+ let(:file) { "nonexistent.txt" }
218
219
+ it "raises an error" do
220
+ expect { subject }.to raise_error(Bundler::GemfileError, /Could not find version file nonexistent.txt/)
221
+ end
222
223
224
225
0 commit comments