Permalink
Browse files

Rescue from spec materialization errors

  • Loading branch information...
1 parent 171bfee commit b0e51cdc453b7e5cdf7b7add5e37793f2f9b79bc Carl Lerche committed Jun 7, 2010
Showing with 35 additions and 2 deletions.
  1. +0 −1 TODO.md
  2. +1 −1 lib/bundler/spec_set.rb
  3. +34 −0 spec/runtime/platform_spec.rb
View
@@ -6,7 +6,6 @@
- bundle irb / bundle ruby / bundle [whatever] -> bundle exec
- Make bundle (install) work when sudo might be needed
- Generate a bundle stub into the application
- - Handle materialization errors
- Handle the following case (no remote fetching):
1) Depend on nokogiri, nokogiri is installed locally (ruby platform)
2) Run bundle package. nokogiri-1.4.2.gem is cached
View
@@ -72,7 +72,7 @@ def materialize(deps, missing_specs = nil)
if missing_specs
missing_specs << s unless spec
else
- raise "Could not materialize #{s.full_name}" unless spec
+ raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
end
spec if spec
end
@@ -0,0 +1,34 @@
+require "spec_helper"
+
+describe "Bundler.setup with multi platform stuff" do
+ it "raises a friendly error when gems are missing locally" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ lockfile <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0)
+
+ PLATFORMS
+ #{local_tag}
+
+ DEPENDENCIES
+ rack
+ G
+
+ ruby <<-R
+ begin
+ require 'bundler'
+ Bundler.setup
+ rescue Bundler::GemNotFound => e
+ puts "WIN"
+ end
+ R
+
+ out.should == "WIN"
+ end
+end

0 comments on commit b0e51cd

Please sign in to comment.