@@ -302,9 +302,9 @@ def should_be_engine_version_incorrect
302302 expect ( err ) . to be_include ( "Your #{ local_ruby_engine } version is #{ local_engine_version } , but your Gemfile specified #{ local_ruby_engine } #{ not_local_engine_version } " )
303303 end
304304
305- def should_be_patchlevel_incorrect
306- expect ( exitstatus ) . to eq ( 18 )
307- expect ( err ) . to be_include ( "Your Ruby patchlevel is #{ RUBY_PATCHLEVEL } , but your Gemfile specified #{ not_local_patchlevel } ")
305+ def should_ignore_patchlevel
306+ expect ( exitstatus ) . to eq ( 0 )
307+ expect ( err ) . to eq ( " ")
308308 end
309309
310310 def should_be_patchlevel_fixnum
@@ -382,16 +382,16 @@ def should_be_patchlevel_fixnum
382382 should_be_engine_version_incorrect
383383 end
384384
385- it "doesn't install when patchlevel doesn't match" do
385+ it "does install even when patchlevel doesn't match" do
386386 install_gemfile <<-G , raise_on_error : false
387387 source "https://gem.repo1"
388388 gem "myrack"
389389
390390 #{ patchlevel_incorrect }
391391 G
392392
393- expect ( bundled_app_lock ) . not_to exist
394- should_be_patchlevel_incorrect
393+ expect ( bundled_app_lock ) . to exist
394+ should_ignore_patchlevel
395395 end
396396 end
397397
@@ -481,7 +481,7 @@ def should_be_patchlevel_fixnum
481481 should_be_engine_version_incorrect
482482 end
483483
484- it "fails when patchlevel doesn't match" do
484+ it "checks fine even when patchlevel doesn't match" do
485485 install_gemfile <<-G
486486 source "https://gem.repo1"
487487 gem "myrack"
@@ -494,8 +494,8 @@ def should_be_patchlevel_fixnum
494494 #{ patchlevel_incorrect }
495495 G
496496
497- bundle :check , raise_on_error : false
498- should_be_patchlevel_incorrect
497+ bundle :check
498+ should_ignore_patchlevel
499499 end
500500 end
501501
@@ -598,19 +598,20 @@ def should_be_patchlevel_fixnum
598598 should_be_engine_version_incorrect
599599 end
600600
601- it "fails when patchlevel doesn't match" do
601+ it "updates fine even when patchlevel doesn't match" do
602602 gemfile <<-G
603- source "https://gem.repo1 "
604- gem "myrack "
603+ source "https://gem.repo2 "
604+ gem "activesupport "
605605
606606 #{ patchlevel_incorrect }
607607 G
608608 update_repo2 do
609609 build_gem "activesupport" , "3.0"
610610 end
611611
612- bundle :update , all : true , raise_on_error : false
613- should_be_patchlevel_incorrect
612+ bundle :update , all : true
613+ should_ignore_patchlevel
614+ expect ( the_bundle ) . to include_gems "activesupport 3.0"
614615 end
615616 end
616617
@@ -682,19 +683,17 @@ def should_be_patchlevel_fixnum
682683 should_be_engine_version_incorrect
683684 end
684685
685- it "fails when patchlevel doesn't match" do
686+ it "prints path even when patchlevel doesn't match" do
686687 gemfile <<-G
687688 source "https://gem.repo1"
688- gem "myrack "
689+ gem "rails "
689690
690691 #{ patchlevel_incorrect }
691692 G
692- update_repo2 do
693- build_gem "activesupport" , "3.0"
694- end
695693
696- bundle "show rails" , raise_on_error : false
697- should_be_patchlevel_incorrect
694+ bundle "show rails"
695+ should_ignore_patchlevel
696+ expect ( out ) . to eq ( default_bundle_path ( "gems" , "rails-2.3.2" ) . to_s )
698697 end
699698 end
700699
@@ -766,16 +765,17 @@ def should_be_patchlevel_fixnum
766765 should_be_engine_version_incorrect
767766 end
768767
769- it "fails when patchlevel doesn't match" do
768+ it "copies the .gem file to vendor/cache even when patchlevel doesn't match" do
770769 gemfile <<-G
771770 source "https://gem.repo1"
772771 gem "myrack"
773772
774773 #{ patchlevel_incorrect }
775774 G
776775
777- bundle :cache , raise_on_error : false
778- should_be_patchlevel_incorrect
776+ bundle :cache
777+ should_ignore_patchlevel
778+ expect ( bundled_app ( "vendor/cache/myrack-1.0.0.gem" ) ) . to exist
779779 end
780780 end
781781
@@ -847,16 +847,17 @@ def should_be_patchlevel_fixnum
847847 should_be_engine_version_incorrect
848848 end
849849
850- it "fails when patchlevel doesn't match" do
850+ it "copies the .gem file to vendor/cache even when patchlevel doesn't match" do
851851 gemfile <<-G
852852 source "https://gem.repo1"
853853 gem "myrack"
854854
855855 #{ patchlevel_incorrect }
856856 G
857857
858- bundle :cache , raise_on_error : false
859- should_be_patchlevel_incorrect
858+ bundle :cache
859+ should_ignore_patchlevel
860+ expect ( bundled_app ( "vendor/cache/myrack-1.0.0.gem" ) ) . to exist
860861 end
861862 end
862863
@@ -926,16 +927,17 @@ def should_be_patchlevel_fixnum
926927 should_be_engine_version_incorrect
927928 end
928929
929- it "fails when patchlevel doesn't match" do
930+ it "activates the correct gem even when patchlevel doesn't match" do
930931 gemfile <<-G
931932 source "https://gem.repo1"
932933 gem "myrack"
933934
934935 #{ patchlevel_incorrect }
935936 G
936937
937- bundle "exec myrackup" , raise_on_error : false
938- should_be_patchlevel_incorrect
938+ bundle "exec myrackup"
939+ should_ignore_patchlevel
940+ expect ( out ) . to include ( "1.0.0" )
939941 end
940942 end
941943
@@ -995,11 +997,15 @@ def should_be_patchlevel_fixnum
995997 should_be_engine_version_incorrect
996998 end
997999
998- it "fails when patchlevel doesn't match" do
1000+ it "starts IRB with the default group loaded even when patchlevel doesn't match" , :readline do
9991001 gemfile gemfile + "\n \n #{ patchlevel_incorrect } \n "
10001002
1001- bundle "console" , raise_on_error : false
1002- should_be_patchlevel_incorrect
1003+ bundle "console" do |input , _ , _ |
1004+ input . puts ( "puts MYRACK" )
1005+ input . puts ( "exit" )
1006+ end
1007+ should_ignore_patchlevel
1008+ expect ( out ) . to include ( "0.9.1" )
10031009 end
10041010 end
10051011
@@ -1095,7 +1101,7 @@ def should_be_patchlevel_fixnum
10951101 should_be_engine_version_incorrect
10961102 end
10971103
1098- it "fails when patchlevel doesn't match" do
1104+ it "makes a Gemfile.lock even when patchlevel doesn't match" do
10991105 install_gemfile <<-G , raise_on_error : false
11001106 source "https://gem.repo1"
11011107 gem "yard"
@@ -1106,10 +1112,10 @@ def should_be_patchlevel_fixnum
11061112
11071113 FileUtils . rm ( bundled_app_lock )
11081114
1109- ruby "require 'bundler/setup'" , env : { "BUNDLER_VERSION" => Bundler ::VERSION } , raise_on_error : false
1115+ ruby "require 'bundler/setup'" , env : { "BUNDLER_VERSION" => Bundler ::VERSION }
11101116
1111- expect ( bundled_app_lock ) . not_to exist
1112- should_be_patchlevel_incorrect
1117+ should_ignore_patchlevel
1118+ expect ( bundled_app_lock ) . to exist
11131119 end
11141120 end
11151121
@@ -1231,7 +1237,7 @@ def should_be_patchlevel_fixnum
12311237 should_be_engine_version_incorrect
12321238 end
12331239
1234- it "fails when the patchlevel doesn't match" , :jruby_only do
1240+ it "reports outdated gems even when patchlevel doesn't match" do
12351241 update_repo2 do
12361242 build_gem "activesupport" , "3.0"
12371243 update_git "foo" , path : lib_path ( "foo" )
@@ -1246,25 +1252,9 @@ def should_be_patchlevel_fixnum
12461252 G
12471253
12481254 bundle "outdated" , raise_on_error : false
1249- should_be_patchlevel_incorrect
1250- end
1251-
1252- it "fails when the patchlevel is a fixnum" , :jruby_only do
1253- update_repo2 do
1254- build_gem "activesupport" , "3.0"
1255- update_git "foo" , path : lib_path ( "foo" )
1256- end
1257-
1258- gemfile <<-G
1259- source "https://gem.repo2"
1260- gem "activesupport", "2.3.5"
1261- gem "foo", :git => "#{ lib_path ( "foo" ) } "
1262-
1263- #{ patchlevel_fixnum }
1264- G
1265-
1266- bundle "outdated" , raise_on_error : false
1267- should_be_patchlevel_fixnum
1255+ expect ( err ) . not_to include ( "patchlevel" )
1256+ expect ( out ) . to include ( "activesupport" )
1257+ expect ( out ) . to include ( "foo" )
12681258 end
12691259 end
12701260end
0 commit comments