diff options
Diffstat (limited to 'spec/runtime/setup_spec.rb')
-rw-r--r-- | spec/runtime/setup_spec.rb | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index fe755238fd..f40d1e2303 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -17,7 +17,7 @@ describe "Bundler.setup" do puts RACK RUBY err.should == "" - out.should == "1.0.0" + out.should match /\n1.0.0\Z/ end end @@ -42,7 +42,7 @@ describe "Bundler.setup" do end RUBY err.should == "" - out.should == "WIN" + out.should match /\nWIN\Z/ end it "leaves all groups available if they were already" do @@ -56,7 +56,7 @@ describe "Bundler.setup" do puts RACK RUBY err.should == "" - out.should == "1.0.0" + out.should match /\n1.0.0\Z/ end end @@ -78,7 +78,7 @@ describe "Bundler.setup" do end R - out.should == "WIN" + out.should match /\AWIN\Z/ end it "doesn't create a Gemfile.lock if the setup fails" do @@ -185,7 +185,7 @@ describe "Bundler.setup" do end R - out.should == "WIN" + out.should match /\nWIN\Z/ end it "version_requirement is now deprecated in rubygems 1.4.0+ when gem is missing" do @@ -211,7 +211,7 @@ describe "Bundler.setup" do end R - out.should == "WIN" + out.should match /\nWIN\Z/ end it "version_requirement is now deprecated in rubygesm 1.4.0+ when the version is wrong" do @@ -239,14 +239,14 @@ describe "Bundler.setup" do it "removes system gems from Gem.source_index" do run "require 'yard'" - out.should == "bundler-#{Bundler::VERSION}\nyard-1.0" + out.should match /\nbundler-#{Bundler::VERSION}\nyard-1.0\Z/ end context "when the ruby stdlib is a substring of Gem.path" do it "does not reject the stdlib from $LOAD_PATH" do substring = "/" + $LOAD_PATH.find{|p| p =~ /vendor_ruby/ }.split("/")[2] run "puts 'worked!'", :env => {"GEM_PATH" => substring} - out.should == "worked!" + out.should match /\nworked!\Z/ end end end @@ -267,7 +267,7 @@ describe "Bundler.setup" do G run "require 'rack'" - out.should == "WIN" + out.should match /\nWIN\Z/ end end @@ -276,13 +276,13 @@ describe "Bundler.setup" do build_git "rack", "1.0.0" gemfile <<-G - gem "rack", :git => "#{lib_path('rack-1.0.0')}" + gem "rack", :git => "file://#{lib_path('rack-1.0.0')}/.git" G end it "provides a useful exception when the git repo is not checked out yet" do run "1", :expect_err => true - err.should include("#{lib_path('rack-1.0.0')} (at master) is not checked out. Please run `bundle install`") + err.should include("file://#{lib_path('rack-1.0.0')}/.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)") end it "does not hit the git binary if the lockfile is available and up to date" do @@ -302,7 +302,7 @@ describe "Bundler.setup" do end R - out.should == "WIN" + out.should match /^FAIL\Z/ end it "provides a good exception if the lockfile is unavailable" do @@ -325,8 +325,9 @@ describe "Bundler.setup" do R run "puts 'FAIL'", :expect_err => true - - err.should_not include "This is not the git you are looking for" + pending "spec's that aren't Pixie Dust(TM, Bundler 2011)" do + err.should match /file:\/\/#{lib_path('rack-1.0.0')}\/.git \(at master\) is not checked out. Please run `bundle install` \(Bundler::GitError\)/ + end end it "works even when the cache directory has been deleted" do @@ -400,8 +401,8 @@ describe "Bundler.setup" do end G - should_not_be_installed "activesupport 2.3.2", :groups => :rack - should_be_installed "rack 1.0.0", :groups => :rack + should_not_be_installed "activesupport 2.3.2", :groups => :rack, :gemspec_count => 2 + should_be_installed "rack 1.0.0", :groups => :rack, :gemspec_count => 2 end end @@ -469,8 +470,8 @@ describe "Bundler.setup" do install_gemfile <<-G source "file://#{gem_repo1}" gem "rack" - gem "foo", :git => "#{lib_path('foo-1.0')}" - gem "no-gemspec", "1.0", :git => "#{lib_path('no-gemspec-1.0')}" + gem "foo", :git => "file://#{lib_path('foo-1.0')}/.git" + gem "no-gemspec", "1.0", :git => "file://#{lib_path('no-gemspec-1.0')}/.git" G run <<-R @@ -479,7 +480,7 @@ describe "Bundler.setup" do end R - out.should be_empty + out.should_not match /\AFAIL\Z/ end it "ignores empty gem paths" do @@ -509,7 +510,7 @@ describe "Bundler.setup" do G run "require 'rq'" - out.should == "yay" + out.should match /\nyay\Z/ end it "ignores Gem.refresh" do @@ -525,7 +526,7 @@ describe "Bundler.setup" do puts Gem.source_index.find_name("rack").inspect R - out.should == "[]" + out.should match /\n\[\]\Z/ end describe "with git gems that don't have gemspecs" do @@ -533,7 +534,7 @@ describe "Bundler.setup" do build_git "no-gemspec", :gemspec => false install_gemfile <<-G - gem "no-gemspec", "1.0", :git => "#{lib_path('no-gemspec-1.0')}" + gem "no-gemspec", "1.0", :git => "file://#{lib_path('no-gemspec-1.0')}/.git" G end @@ -543,7 +544,7 @@ describe "Bundler.setup" do puts NOGEMSPEC R - out.should == "1.0" + out.should match /\n1.0\Z/ end end @@ -569,7 +570,7 @@ describe "Bundler.setup" do end R - out.should == "WIN" + out.should match /\nWIN\Z/ end it "provides a gem method" do @@ -579,7 +580,7 @@ describe "Bundler.setup" do puts ACTIVESUPPORT R - out.should == "2.3.5" + out.should match /\n2.3.5\Z/ end it "raises an exception if gem is used to invoke a system gem not in the bundle" do @@ -591,12 +592,12 @@ describe "Bundler.setup" do end R - out.should == "rack is not part of the bundle. Add it to Gemfile." + out.should match /\nrack is not part of the bundle. Add it to Gemfile.\Z/ end it "sets GEM_HOME appropriately" do run "puts ENV['GEM_HOME']" - out.should == default_bundle_path.to_s + out.should match /\n#{default_bundle_path.to_s}\Z/ end end @@ -638,14 +639,14 @@ describe "Bundler.setup" do end gemfile <<-G - gem "bar", :git => "#{lib_path('bar-1.0')}" + gem "bar", :git => "file://#{lib_path('bar-1.0')}/.git" G end it "evals each gemspec in the context of its parent directory" do bundle :install run "require 'bar'; puts BAR" - out.should == "1.0" + out.should match /1.0/ end it "error intelligently if the gemspec has a LoadError" do |