summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2012-11-28 22:32:11 -0800
committerAndre Arko <andre@arko.net>2012-11-28 22:32:11 -0800
commit6c3aa10498334b3101e6ef3f96666e17440dab53 (patch)
tree86c51087d57a513844159b021359f24592512df1
parent5cec321f1c146743df769f18d79b79e2884f2389 (diff)
downloadbundler-6c3aa10498334b3101e6ef3f96666e17440dab53.tar.gz
Revert "Merge pull request #2186 from Empact/namespaced-loaderror"
Turns out this wasn't actually passing after all. Oops. This reverts commit 22f17a89e2cdbfa3580e56d744967aca7cef7d3a, reversing changes made to c0fe3d864e24cb7f691e20e4b262296708cb95d5.
-rw-r--r--lib/bundler/runtime.rb6
-rw-r--r--spec/runtime/require_spec.rb22
2 files changed, 3 insertions, 25 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index d4a432454b..db6f21d698 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -68,9 +68,6 @@ module Bundler
Kernel.require file
end
rescue LoadError => e
- REGEXPS.find { |r| r =~ e.message }
- raise if dep.autorequire || $1 != required_file
-
if dep.autorequire.nil? && dep.name.include?('-')
begin
namespaced_file = dep.name.gsub('-', '/')
@@ -81,6 +78,9 @@ module Bundler
raise if dep.autorequire || (regex_name && regex_name.gsub('-', '/') != namespaced_file)
raise e if regex_name.nil?
end
+ else
+ REGEXPS.find { |r| r =~ e.message }
+ raise if dep.autorequire || $1 != required_file
end
end
end
diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb
index db72ff70f0..349696606b 100644
--- a/spec/runtime/require_spec.rb
+++ b/spec/runtime/require_spec.rb
@@ -158,28 +158,6 @@ 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