aboutsummaryrefslogtreecommitdiffstats
path: root/spec/runtime
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2012-08-14 01:08:54 -0500
committerTerence Lee <hone02@gmail.com>2012-08-14 01:08:58 -0500
commit67c6fcba6f97b0a870ae62325b28eb89c9c2ad6c (patch)
treebd7948fd7d5c6a50558d39bd46de2931f8997155 /spec/runtime
parent3a1121a568f8b6785429291a080de2fa6188c520 (diff)
downloadbundler-67c6fcba6f97b0a870ae62325b28eb89c9c2ad6c.tar.gz
namespace gem require logic handles case where regex fails
Diffstat (limited to 'spec/runtime')
-rw-r--r--spec/runtime/require_spec.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb
index fdd0a424..2f2c73f8 100644
--- a/spec/runtime/require_spec.rb
+++ b/spec/runtime/require_spec.rb
@@ -107,7 +107,7 @@ describe "Bundler.require" do
out.should eq("jquery/rails")
end
- it "does not mangle explictly given requires" do
+ it "handles the case where the regex fails" do
gemfile <<-G
path "#{lib_path}"
gem 'jquery-rails', :require => 'jquery-rails'
@@ -118,6 +118,29 @@ describe "Bundler.require" do
R
err.should == "ZOMG LOAD ERROR"
end
+
+ it "doesn't obscure actual error messages" do
+ build_lib "load-fuuu", "1.0.0" do |s|
+ s.write "lib/load-fuuu.rb", "require 'load/fuuu'"
+ s.write "lib/load/fuuu.rb", "raise LoadError.new(\"Could not open library 'libfuuu-1.0': libfuuu-1.0: cannot open shared object file: No such file or directory.\")"
+ end
+
+ gemfile <<-G
+ path "#{lib_path}"
+ gem "load-fuuu"
+ G
+
+ cmd = <<-RUBY
+ begin
+ Bundler.require
+ rescue LoadError => e
+ $stderr.puts "ZOMG LOAD ERROR" if e.message.include?("Could not open library 'libfuuu-1.0'")
+ end
+ RUBY
+ run(cmd, :expect_err => true)
+
+ err.should == "ZOMG LOAD ERROR"
+ end
end
describe "using bundle exec" do