diff options
Diffstat (limited to 'spec/runtime/load_spec.rb')
-rw-r--r-- | spec/runtime/load_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/runtime/load_spec.rb b/spec/runtime/load_spec.rb index 05ed076b6d..b74dbde3f6 100644 --- a/spec/runtime/load_spec.rb +++ b/spec/runtime/load_spec.rb @@ -45,7 +45,6 @@ RSpec.describe "Bundler.load" do describe "without a gemfile" do it "raises an exception if the default gemfile is not found" do - ensure_no_gemfile expect do Bundler.load end.to raise_error(Bundler::GemfileNotFound, /could not locate gemfile/i) @@ -57,6 +56,19 @@ RSpec.describe "Bundler.load" do Bundler.load end.to raise_error(Bundler::GemfileNotFound, /omg\.rb/) end + + it "does not find a Gemfile above the testing directory" do + bundler_gemfile = tmp.join("../Gemfile") + unless File.exist?(bundler_gemfile) + FileUtils.touch(bundler_gemfile) + @remove_bundler_gemfile = true + end + begin + expect { Bundler.load }.to raise_error(Bundler::GemfileNotFound) + ensure + bundler_gemfile.rmtree if @remove_bundler_gemfile + end + end end describe "when called twice" do |