aboutsummaryrefslogtreecommitdiffstats
path: root/spec/runtime/require_spec.rb
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2012-11-26 07:33:21 -0600
committerBen Woosley <ben.woosley@gmail.com>2012-11-26 07:33:21 -0600
commitbfd7280db05f8d19e7c5a4fd1c044799524aafc0 (patch)
tree6d4ba153db2a6f63103947fe5f26059b5897fc13 /spec/runtime/require_spec.rb
parent4680712be12c1aa982f163353c300ec564b7f797 (diff)
downloadbundler-bfd7280db05f8d19e7c5a4fd1c044799524aafc0.tar.gz
Because required files can sometimes themselves contain unrelated LoadErrors (e.g. during inter-gem development), run the regexps against the LoadError before the namespaced fallback check.
Diffstat (limited to 'spec/runtime/require_spec.rb')
-rw-r--r--spec/runtime/require_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb
index 34969660..db72ff70 100644
--- a/spec/runtime/require_spec.rb
+++ b/spec/runtime/require_spec.rb
@@ -158,6 +158,28 @@ describe "Bundler.require" do
expect(err).to eq("ZOMG LOAD ERROR")
end
+
+ it "doesn't swallow the error when the library has an unrelated error" do
+ build_lib "load-fuuu", "1.0.0" do |s|
+ s.write "lib/load-fuuu.rb", "raise LoadError.new(\"cannot load such file -- load-bar\")"
+ end
+
+ gemfile <<-G
+ path "#{lib_path}"
+ gem "load-fuuu"
+ G
+
+ cmd = <<-RUBY
+ begin
+ Bundler.require
+ rescue LoadError => e
+ $stderr.puts "ZOMG LOAD ERROR: \#{e.message}"
+ end
+ RUBY
+ run(cmd, :expect_err => true)
+
+ expect(err).to eq("ZOMG LOAD ERROR: cannot load such file -- load-bar")
+ end
end
describe "using bundle exec" do