aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-06-25 17:55:35 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-06-25 17:58:39 -0700
commitfe29acb063aef06915f56cffe8764b131748db21 (patch)
treebdc7802a5fbd5c8d83e3b255003b554ea86e7550 /spec
parenta37d0a72997ccd79d23d4a98e98544a6203147b9 (diff)
downloadbundler-fe29acb063aef06915f56cffe8764b131748db21.tar.gz
Raise an activation error if a rubygem is already activated that conflicts with the Gemfile
Diffstat (limited to 'spec')
-rw-r--r--spec/runtime/setup_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index e3c133ff..8623bc2e 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -166,6 +166,33 @@ describe "Bundler.setup" do
end
end
+ describe "preactivated gems" do
+ it "raises an exception if a pre activated gem conflicts with the bundle" do
+ system_gems "thin-1.0", "rack-1.0.0"
+ build_gem "thin", "1.1", :to_system => true do |s|
+ s.add_dependency "rack"
+ end
+
+ gemfile <<-G
+ gem "thin", "1.0"
+ G
+
+ ruby <<-R
+ require 'rubygems'
+ gem "thin"
+ require 'bundler'
+ begin
+ Bundler.setup
+ puts "FAIL"
+ rescue Gem::LoadError => e
+ puts e.message
+ end
+ R
+
+ out.should == "You have already activated thin 1.1, but your Gemfile requires thin 1.0. Consider using bundle exec."
+ end
+ end
+
# Rubygems returns loaded_from as a string
it "has loaded_from as a string on all specs" do
build_git "foo"