diff options
author | Andre Arko <andre@arko.net> | 2011-11-30 12:59:51 -1000 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2011-11-30 13:00:01 -1000 |
commit | 96366953fc76e5850d73fb19f2b7ac7936bb0532 (patch) | |
tree | 56421201f191eb525f02b0bf5123c36982ed564b /spec/runtime/require_spec.rb | |
parent | af400195ddd6866b6188ed29a87efc105522c740 (diff) | |
download | bundler-96366953fc76e5850d73fb19f2b7ac7936bb0532.tar.gz |
only auto-namespace requires for implied requires
fixes #1531
Diffstat (limited to 'spec/runtime/require_spec.rb')
-rw-r--r-- | spec/runtime/require_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb index bad1ec97..fdd0a424 100644 --- a/spec/runtime/require_spec.rb +++ b/spec/runtime/require_spec.rb @@ -89,6 +89,37 @@ describe "Bundler.require" do err.should == "ZOMG LOAD ERROR" end + describe "with namespaced gems" do + before :each do + build_lib "jquery-rails", "1.0.0" do |s| + s.write "lib/jquery/rails.rb", "puts 'jquery/rails'" + end + lib_path('jquery-rails-1.0.0/lib/jquery-rails.rb').rmtree + end + + it "requires gem names that are namespaced" do + gemfile <<-G + path '#{lib_path}' + gem 'jquery-rails' + G + + run "Bundler.require" + out.should eq("jquery/rails") + end + + it "does not mangle explictly given requires" do + gemfile <<-G + path "#{lib_path}" + gem 'jquery-rails', :require => 'jquery-rails' + G + + load_error_run <<-R, 'jquery-rails' + Bundler.require + R + err.should == "ZOMG LOAD ERROR" + end + end + describe "using bundle exec" do it "requires the locked gems" do bundle "exec ruby -e 'Bundler.require'" |