diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-06-25 17:55:35 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-06-25 17:58:39 -0700 |
commit | fe29acb063aef06915f56cffe8764b131748db21 (patch) | |
tree | bdc7802a5fbd5c8d83e3b255003b554ea86e7550 /spec | |
parent | a37d0a72997ccd79d23d4a98e98544a6203147b9 (diff) | |
download | bundler-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.rb | 27 |
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" |