bundler 1.4.0.pre.1 → 1.4.0.pre.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (63) hide show
  1. data/.travis.yml +18 -7
  2. data/CHANGELOG.md +15 -0
  3. data/CONTRIBUTING.md +8 -0
  4. data/DEVELOPMENT.md +27 -25
  5. data/ISSUES.md +33 -20
  6. data/README.md +6 -4
  7. data/Rakefile +1 -1
  8. data/UPGRADING.md +1 -1
  9. data/bin/bundle +1 -1
  10. data/bin/bundler +10 -0
  11. data/bundler.gemspec +2 -2
  12. data/lib/bundler/capistrano.rb +4 -0
  13. data/lib/bundler/cli.rb +7 -0
  14. data/lib/bundler/current_ruby.rb +9 -1
  15. data/lib/bundler/definition.rb +2 -0
  16. data/lib/bundler/dependency.rb +3 -1
  17. data/lib/bundler/dsl.rb +1 -1
  18. data/lib/bundler/fetcher.rb +1 -1
  19. data/lib/bundler/friendly_errors.rb +5 -0
  20. data/lib/bundler/gem_helpers.rb +7 -6
  21. data/lib/bundler/installer.rb +27 -20
  22. data/lib/bundler/parallel_workers/unix_worker.rb +2 -2
  23. data/lib/bundler/ruby_dsl.rb +1 -1
  24. data/lib/bundler/ruby_version.rb +12 -3
  25. data/lib/bundler/rubygems_ext.rb +1 -0
  26. data/lib/bundler/rubygems_integration.rb +1 -1
  27. data/lib/bundler/runtime.rb +2 -1
  28. data/lib/bundler/shared_helpers.rb +13 -0
  29. data/lib/bundler/source/git.rb +3 -3
  30. data/lib/bundler/source/git/git_proxy.rb +1 -1
  31. data/lib/bundler/source/path.rb +1 -2
  32. data/lib/bundler/source/rubygems.rb +3 -5
  33. data/lib/bundler/version.rb +1 -1
  34. data/man/bundle.ronn +1 -1
  35. data/man/gemfile.5.ronn +6 -2
  36. data/spec/bundler/dsl_spec.rb +2 -2
  37. data/spec/bundler/friendly_errors_spec.rb +13 -0
  38. data/spec/{other → commands}/binstubs_spec.rb +0 -0
  39. data/spec/{other → commands}/check_spec.rb +0 -0
  40. data/spec/{other → commands}/clean_spec.rb +0 -0
  41. data/spec/{other → commands}/config_spec.rb +0 -0
  42. data/spec/{other → commands}/console_spec.rb +0 -0
  43. data/spec/{other → commands}/exec_spec.rb +0 -0
  44. data/spec/{other → commands}/help_spec.rb +0 -0
  45. data/spec/{other → commands}/init_spec.rb +0 -0
  46. data/spec/{other → commands}/licenses_spec.rb +0 -0
  47. data/spec/{other → commands}/newgem_spec.rb +0 -0
  48. data/spec/{other → commands}/open_spec.rb +0 -0
  49. data/spec/{other → commands}/outdated_spec.rb +0 -0
  50. data/spec/{other → commands}/show_spec.rb +0 -0
  51. data/spec/install/gems/dependency_api_spec.rb +14 -0
  52. data/spec/install/git_spec.rb +42 -0
  53. data/spec/other/bundle_ruby_spec.rb +105 -75
  54. data/spec/other/cli_dispatch_spec.rb +21 -0
  55. data/spec/other/ext_spec.rb +23 -0
  56. data/spec/other/platform_spec.rb +204 -4
  57. data/spec/resolver/platform_spec.rb +7 -1
  58. data/spec/runtime/setup_spec.rb +1 -1
  59. data/spec/support/builders.rb +5 -1
  60. data/spec/support/indexes.rb +1 -1
  61. data/spec/support/platforms.rb +9 -1
  62. metadata +116 -84
  63. checksums.yaml +0 -7
@@ -853,6 +853,48 @@ describe "bundle install with git sources" do
853
853
  R
854
854
  expect(out).to eq("YES")
855
855
  end
856
+
857
+ it "does not prompt to gem install if extension fails" do
858
+ build_git "foo" do |s|
859
+ s.add_dependency "rake"
860
+ s.extensions << "Rakefile"
861
+ s.write "Rakefile", <<-RUBY
862
+ task :default do
863
+ raise
864
+ end
865
+ RUBY
866
+ end
867
+
868
+ install_gemfile <<-G
869
+ source "file://#{gem_repo1}"
870
+ gem "foo", :git => "#{lib_path('foo-1.0')}"
871
+ G
872
+
873
+ expect(out).to include("An error occurred while installing foo (1.0)")
874
+ expect(out).not_to include("gem install foo")
875
+ end
876
+ end
877
+
878
+ it "ignores git environment variables" do
879
+ build_git "xxxxxx" do |s|
880
+ s.executables = "xxxxxxbar"
881
+ end
882
+
883
+ Bundler::SharedHelpers.with_clean_git_env do
884
+ ENV['GIT_DIR'] = 'bar'
885
+ ENV['GIT_WORK_TREE'] = 'bar'
886
+
887
+ install_gemfile <<-G, :exitstatus => true
888
+ source "file://#{gem_repo1}"
889
+ git "#{lib_path('xxxxxx-1.0')}" do
890
+ gem 'xxxxxx'
891
+ end
892
+ G
893
+
894
+ expect(exitstatus).to eq(0)
895
+ expect(ENV['GIT_DIR']).to eq('bar')
896
+ expect(ENV['GIT_WORK_TREE']).to eq('bar')
897
+ end
856
898
  end
857
899
 
858
900
  end
@@ -1,112 +1,142 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "bundle_ruby" do
4
- it "returns the ruby version" do
5
- gemfile <<-G
6
- source "file://#{gem_repo1}"
7
- ruby "1.9.3", :engine => 'ruby', :engine_version => '1.9.3'
4
+ context "without patchlevel" do
5
+ it "returns the ruby version" do
6
+ gemfile <<-G
7
+ source "file://#{gem_repo1}"
8
+ ruby "1.9.3", :engine => 'ruby', :engine_version => '1.9.3'
8
9
 
9
- gem "foo"
10
- G
10
+ gem "foo"
11
+ G
11
12
 
12
- bundle_ruby
13
+ bundle_ruby
13
14
 
14
- expect(out).to eq("ruby 1.9.3")
15
- end
15
+ expect(out).to eq("ruby 1.9.3")
16
+ end
16
17
 
17
- it "engine defaults to MRI" do
18
- gemfile <<-G
19
- source "file://#{gem_repo1}"
20
- ruby "1.9.3"
18
+ it "engine defaults to MRI" do
19
+ gemfile <<-G
20
+ source "file://#{gem_repo1}"
21
+ ruby "1.9.3"
21
22
 
22
- gem "foo"
23
- G
23
+ gem "foo"
24
+ G
24
25
 
25
- bundle_ruby
26
+ bundle_ruby
26
27
 
27
- expect(out).to eq("ruby 1.9.3")
28
- end
28
+ expect(out).to eq("ruby 1.9.3")
29
+ end
29
30
 
30
- it "handles jruby" do
31
- gemfile <<-G
32
- source "file://#{gem_repo1}"
33
- ruby "1.8.7", :engine => 'jruby', :engine_version => '1.6.5'
31
+ it "handles jruby" do
32
+ gemfile <<-G
33
+ source "file://#{gem_repo1}"
34
+ ruby "1.8.7", :engine => 'jruby', :engine_version => '1.6.5'
34
35
 
35
- gem "foo"
36
- G
36
+ gem "foo"
37
+ G
37
38
 
38
- bundle_ruby
39
+ bundle_ruby
39
40
 
40
- expect(out).to eq("ruby 1.8.7 (jruby 1.6.5)")
41
- end
41
+ expect(out).to eq("ruby 1.8.7 (jruby 1.6.5)")
42
+ end
42
43
 
43
- it "handles rbx" do
44
- gemfile <<-G
45
- source "file://#{gem_repo1}"
46
- ruby "1.8.7", :engine => 'rbx', :engine_version => '1.2.4'
44
+ it "handles rbx" do
45
+ gemfile <<-G
46
+ source "file://#{gem_repo1}"
47
+ ruby "1.8.7", :engine => 'rbx', :engine_version => '1.2.4'
47
48
 
48
- gem "foo"
49
- G
49
+ gem "foo"
50
+ G
50
51
 
51
- bundle_ruby
52
+ bundle_ruby
52
53
 
53
- expect(out).to eq("ruby 1.8.7 (rbx 1.2.4)")
54
- end
54
+ expect(out).to eq("ruby 1.8.7 (rbx 1.2.4)")
55
+ end
55
56
 
56
- it "raises an error if engine is used but engine version is not" do
57
- gemfile <<-G
58
- source "file://#{gem_repo1}"
59
- ruby "1.8.7", :engine => 'rbx'
57
+ it "raises an error if engine is used but engine version is not" do
58
+ gemfile <<-G
59
+ source "file://#{gem_repo1}"
60
+ ruby "1.8.7", :engine => 'rbx'
60
61
 
61
- gem "foo"
62
- G
62
+ gem "foo"
63
+ G
63
64
 
64
- bundle_ruby :exitstatus => true
65
- expect(exitstatus).not_to eq(0)
65
+ bundle_ruby :exitstatus => true
66
+ expect(exitstatus).not_to eq(0)
66
67
 
67
- bundle_ruby
68
- expect(out).to eq("Please define :engine_version")
69
- end
68
+ bundle_ruby
69
+ expect(out).to eq("Please define :engine_version")
70
+ end
70
71
 
71
- it "raises an error if engine_version is used but engine is not" do
72
- gemfile <<-G
73
- source "file://#{gem_repo1}"
74
- ruby "1.8.7", :engine_version => '1.2.4'
72
+ it "raises an error if engine_version is used but engine is not" do
73
+ gemfile <<-G
74
+ source "file://#{gem_repo1}"
75
+ ruby "1.8.7", :engine_version => '1.2.4'
75
76
 
76
- gem "foo"
77
- G
77
+ gem "foo"
78
+ G
78
79
 
79
- bundle_ruby :exitstatus => true
80
- expect(exitstatus).not_to eq(0)
80
+ bundle_ruby :exitstatus => true
81
+ expect(exitstatus).not_to eq(0)
81
82
 
82
- bundle_ruby
83
- expect(out).to eq("Please define :engine")
84
- end
83
+ bundle_ruby
84
+ expect(out).to eq("Please define :engine")
85
+ end
86
+
87
+ it "raises an error if engine version doesn't match ruby version for MRI" do
88
+ gemfile <<-G
89
+ source "file://#{gem_repo1}"
90
+ ruby "1.8.7", :engine => 'ruby', :engine_version => '1.2.4'
85
91
 
86
- it "raises an error if engine version doesn't match ruby version for MRI" do
87
- gemfile <<-G
88
- source "file://#{gem_repo1}"
89
- ruby "1.8.7", :engine => 'ruby', :engine_version => '1.2.4'
92
+ gem "foo"
93
+ G
90
94
 
91
- gem "foo"
92
- G
95
+ bundle_ruby :exitstatus => true
96
+ expect(exitstatus).not_to eq(0)
93
97
 
94
- bundle_ruby :exitstatus => true
95
- expect(exitstatus).not_to eq(0)
98
+ bundle_ruby
99
+ expect(out).to eq("ruby_version must match the :engine_version for MRI")
100
+ end
96
101
 
97
- bundle_ruby
98
- expect(out).to eq("ruby_version must match the :engine_version for MRI")
102
+ it "should print if no ruby version is specified" do
103
+ gemfile <<-G
104
+ source "file://#{gem_repo1}"
105
+
106
+ gem "foo"
107
+ G
108
+
109
+ bundle_ruby
110
+
111
+ expect(out).to eq("No ruby version specified")
112
+ end
99
113
  end
100
114
 
101
- it "should print if no ruby version is specified" do
102
- gemfile <<-G
103
- source "file://#{gem_repo1}"
115
+ context "when using patchlevel" do
116
+ it "returns the ruby version" do
117
+ gemfile <<-G
118
+ source "file://#{gem_repo1}"
119
+ ruby "1.9.3", :patchlevel => 429, :engine => 'ruby', :engine_version => '1.9.3'
120
+
121
+ gem "foo"
122
+ G
123
+
124
+ bundle_ruby
125
+
126
+ expect(out).to eq("ruby 1.9.3p429")
127
+ end
128
+
129
+ it "handles an engine" do
130
+ gemfile <<-G
131
+ source "file://#{gem_repo1}"
132
+ ruby "1.9.3", :patchlevel => 392, :engine => 'jruby', :engine_version => '1.7.4'
104
133
 
105
- gem "foo"
106
- G
134
+ gem "foo"
135
+ G
107
136
 
108
- bundle_ruby
137
+ bundle_ruby
109
138
 
110
- expect(out).to eq("No ruby version specified")
139
+ expect(out).to eq("ruby 1.9.3p392 (jruby 1.7.4)")
140
+ end
111
141
  end
112
142
  end
@@ -0,0 +1,21 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle command names" do
4
+ it "work when given fully" do
5
+ bundle "install"
6
+ expect(err).to eq("")
7
+ expect(out).not_to match(/Ambiguous command/)
8
+ end
9
+
10
+ it "work when not ambiguous" do
11
+ bundle "ins"
12
+ expect(err).to eq("")
13
+ expect(out).not_to match(/Ambiguous command/)
14
+ end
15
+
16
+ it "print a friendly error when ambiguous" do
17
+ bundle "i"
18
+ expect(err).to eq("")
19
+ expect(out).to match(/Ambiguous command/)
20
+ end
21
+ end
@@ -12,6 +12,29 @@ describe "Bundler::GemHelpers#generic" do
12
12
 
13
13
  it "converts non-windows platforms into ruby" do
14
14
  expect(generic(pl('x86-darwin-10'))).to eq(pl('ruby'))
15
+ expect(generic(pl('ruby'))).to eq(pl('ruby'))
16
+ end
17
+
18
+ it "converts java platform variants into java" do
19
+ expect(generic(pl('universal-java-17'))).to eq(pl('java'))
20
+ expect(generic(pl('java'))).to eq(pl('java'))
21
+ end
22
+
23
+ it "converts mswin platform variants into x86-mswin32" do
24
+ expect(generic(pl('mswin32'))).to eq(pl('x86-mswin32'))
25
+ expect(generic(pl('i386-mswin32'))).to eq(pl('x86-mswin32'))
26
+ expect(generic(pl('x86-mswin32'))).to eq(pl('x86-mswin32'))
27
+ end
28
+
29
+ it "converts 32-bit mingw platform variants into x86-mingw32" do
30
+ expect(generic(pl('mingw32'))).to eq(pl('x86-mingw32'))
31
+ expect(generic(pl('i386-mingw32'))).to eq(pl('x86-mingw32'))
32
+ expect(generic(pl('x86-mingw32'))).to eq(pl('x86-mingw32'))
33
+ end
34
+
35
+ it "converts 64-bit mingw platform variants into x64-mingw32" do
36
+ expect(generic(pl('x64-mingw32'))).to eq(pl('x64-mingw32'))
37
+ expect(generic(pl('x86_64-mingw32'))).to eq(pl('x64-mingw32'))
15
38
  end
16
39
  end
17
40
 
@@ -21,6 +21,29 @@ Your app has gems that work on these platforms:
21
21
  Your Gemfile specifies a Ruby version requirement:
22
22
  * ruby #{RUBY_VERSION}
23
23
 
24
+ Your current platform satisfies the Ruby version requirement.
25
+ G
26
+ end
27
+
28
+ it "returns all the output including the patchlevel" do
29
+ gemfile <<-G
30
+ source "file://#{gem_repo1}"
31
+
32
+ #{ruby_version_correct_patchlevel}
33
+
34
+ gem "foo"
35
+ G
36
+
37
+ bundle "platform"
38
+ expect(out).to eq(<<-G.chomp)
39
+ Your platform is: #{RUBY_PLATFORM}
40
+
41
+ Your app has gems that work on these platforms:
42
+ * ruby
43
+
44
+ Your Gemfile specifies a Ruby version requirement:
45
+ * ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}
46
+
24
47
  Your current platform satisfies the Ruby version requirement.
25
48
  G
26
49
  end
@@ -175,9 +198,11 @@ G
175
198
 
176
199
  let(:ruby_version_correct) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{local_engine_version}\"" }
177
200
  let(:ruby_version_correct_engineless) { "ruby \"#{RUBY_VERSION}\"" }
201
+ let(:ruby_version_correct_patchlevel) { "#{ruby_version_correct}, :patchlevel => #{RUBY_PATCHLEVEL}" }
178
202
  let(:ruby_version_incorrect) { "ruby \"#{not_local_ruby_version}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{not_local_ruby_version}\"" }
179
203
  let(:engine_incorrect) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{not_local_tag}\", :engine_version => \"#{RUBY_VERSION}\"" }
180
204
  let(:engine_version_incorrect) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{not_local_engine_version}\"" }
205
+ let(:patchlevel_incorrect) { "#{ruby_version_correct}, :patchlevel => #{not_local_patchlevel}" }
181
206
 
182
207
  def should_be_ruby_version_incorrect(opts = {:exitstatus => true})
183
208
  expect(exitstatus).to eq(18) if opts[:exitstatus]
@@ -194,6 +219,12 @@ G
194
219
  expect(out).to be_include("Your #{local_ruby_engine} version is #{local_engine_version}, but your Gemfile specified #{local_ruby_engine} #{not_local_engine_version}")
195
220
  end
196
221
 
222
+ def should_be_patchlevel_incorrect(opts = {:exitstatus => true})
223
+ expect(exitstatus).to eq(18) if opts[:exitstatus]
224
+
225
+ expect(out).to be_include("Your Ruby patchlevel is #{RUBY_PATCHLEVEL}, but your Gemfile specified #{not_local_patchlevel}")
226
+ end
227
+
197
228
  context "bundle install" do
198
229
  it "installs fine when the ruby version matches" do
199
230
  install_gemfile <<-G
@@ -219,6 +250,17 @@ G
219
250
  end
220
251
  end
221
252
 
253
+ it "installs fine when the patchlevel matches" do
254
+ install_gemfile <<-G
255
+ source "file://#{gem_repo1}"
256
+ gem "rack"
257
+
258
+ #{ruby_version_correct_patchlevel}
259
+ G
260
+
261
+ expect(bundled_app('Gemfile.lock')).to exist
262
+ end
263
+
222
264
  it "doesn't install when the ruby version doesn't match" do
223
265
  install_gemfile <<-G, :exitstatus => true
224
266
  source "file://#{gem_repo1}"
@@ -256,6 +298,18 @@ G
256
298
  should_be_engine_version_incorrect
257
299
  end
258
300
  end
301
+
302
+ it "doesn't install when patchlevel doesn't match" do
303
+ install_gemfile <<-G, :exitstatus => true
304
+ source "file://#{gem_repo1}"
305
+ gem "rack"
306
+
307
+ #{patchlevel_incorrect}
308
+ G
309
+
310
+ expect(bundled_app('Gemfile.lock')).not_to exist
311
+ should_be_patchlevel_incorrect
312
+ end
259
313
  end
260
314
 
261
315
  context "bundle check" do
@@ -349,6 +403,23 @@ G
349
403
  should_be_engine_version_incorrect
350
404
  end
351
405
  end
406
+
407
+ it "fails when patchlevel doesn't match" do
408
+ install_gemfile <<-G, :exitstatus => true
409
+ source "file://#{gem_repo1}"
410
+ gem "rack"
411
+ G
412
+
413
+ gemfile <<-G
414
+ source "file://#{gem_repo1}"
415
+ gem "rack"
416
+
417
+ #{patchlevel_incorrect}
418
+ G
419
+
420
+ bundle :check, :exitstatus => true
421
+ should_be_patchlevel_incorrect
422
+ end
352
423
  end
353
424
 
354
425
  context "bundle update" do
@@ -445,6 +516,21 @@ G
445
516
  should_be_engine_version_incorrect
446
517
  end
447
518
  end
519
+
520
+ it "fails when patchlevel doesn't match" do
521
+ gemfile <<-G, :exitstatus => true
522
+ source "file://#{gem_repo1}"
523
+ gem "rack"
524
+
525
+ #{patchlevel_incorrect}
526
+ G
527
+ update_repo2 do
528
+ build_gem "activesupport", "3.0"
529
+ end
530
+
531
+ bundle :update, :exitstatus => true
532
+ should_be_patchlevel_incorrect
533
+ end
448
534
  end
449
535
 
450
536
  context "bundle show" do
@@ -518,6 +604,21 @@ G
518
604
  should_be_engine_version_incorrect
519
605
  end
520
606
  end
607
+
608
+ it "fails when patchlevel doesn't match" do
609
+ gemfile <<-G, :exitstatus => true
610
+ source "file://#{gem_repo1}"
611
+ gem "rack"
612
+
613
+ #{patchlevel_incorrect}
614
+ G
615
+ update_repo2 do
616
+ build_gem "activesupport", "3.0"
617
+ end
618
+
619
+ bundle "show rails", :exitstatus => true
620
+ should_be_patchlevel_incorrect
621
+ end
521
622
  end
522
623
 
523
624
  context "bundle cache" do
@@ -578,15 +679,27 @@ G
578
679
  it "fails if the engine version doesn't match" do
579
680
  simulate_ruby_engine "jruby" do
580
681
  gemfile <<-G
581
- gem 'rack'
682
+ gem 'rack'
582
683
 
583
- #{engine_version_incorrect}
684
+ #{engine_version_incorrect}
584
685
  G
585
686
 
586
687
  bundle :cache, :exitstatus => true
587
688
  should_be_engine_version_incorrect
588
689
  end
589
690
  end
691
+
692
+ it "fails when patchlevel doesn't match" do
693
+ gemfile <<-G, :exitstatus => true
694
+ source "file://#{gem_repo1}"
695
+ gem "rack"
696
+
697
+ #{patchlevel_incorrect}
698
+ G
699
+
700
+ bundle :cache, :exitstatus => true
701
+ should_be_patchlevel_incorrect
702
+ end
590
703
  end
591
704
 
592
705
  context "bundle pack" do
@@ -647,15 +760,27 @@ G
647
760
  it "fails if the engine version doesn't match" do
648
761
  simulate_ruby_engine "jruby" do
649
762
  gemfile <<-G
650
- gem 'rack'
763
+ gem 'rack'
651
764
 
652
- #{engine_version_incorrect}
765
+ #{engine_version_incorrect}
653
766
  G
654
767
 
655
768
  bundle :pack, :exitstatus => true
656
769
  should_be_engine_version_incorrect
657
770
  end
658
771
  end
772
+
773
+ it "fails when patchlevel doesn't match" do
774
+ gemfile <<-G, :exitstatus => true
775
+ source "file://#{gem_repo1}"
776
+ gem "rack"
777
+
778
+ #{patchlevel_incorrect}
779
+ G
780
+
781
+ bundle :pack, :exitstatus => true
782
+ should_be_patchlevel_incorrect
783
+ end
659
784
  end
660
785
 
661
786
  context "bundle exec" do
@@ -721,6 +846,18 @@ G
721
846
  should_be_engine_version_incorrect
722
847
  end
723
848
  end
849
+
850
+ it "fails when patchlevel doesn't match" do
851
+ gemfile <<-G, :exitstatus => true
852
+ source "file://#{gem_repo1}"
853
+ gem "rack"
854
+
855
+ #{patchlevel_incorrect}
856
+ G
857
+
858
+ bundle "exec rackup", :exitstatus => true
859
+ should_be_patchlevel_incorrect
860
+ end
724
861
  end
725
862
 
726
863
  context "bundle console" do
@@ -812,6 +949,20 @@ G
812
949
  should_be_engine_version_incorrect
813
950
  end
814
951
  end
952
+
953
+ it "fails when patchlevel doesn't match" do
954
+ gemfile <<-G, :exitstatus => true
955
+ source "file://#{gem_repo1}"
956
+ gem "rack"
957
+ gem "activesupport", :group => :test
958
+ gem "rack_middleware", :group => :development
959
+
960
+ #{patchlevel_incorrect}
961
+ G
962
+
963
+ bundle "console", :exitstatus => true
964
+ should_be_patchlevel_incorrect
965
+ end
815
966
  end
816
967
 
817
968
  context "Bundler.setup" do
@@ -944,6 +1095,35 @@ G
944
1095
  should_be_engine_version_incorrect(:exitstatus => false)
945
1096
  end
946
1097
  end
1098
+
1099
+ it "fails when patchlevel doesn't match" do
1100
+ install_gemfile <<-G
1101
+ source "file://#{gem_repo1}"
1102
+ gem "yard"
1103
+ gem "rack"
1104
+
1105
+ #{patchlevel_incorrect}
1106
+ G
1107
+
1108
+ puts File.read(bundled_app("Gemfile"))
1109
+ File.read(bundled_app("Gemfile.lock"))
1110
+
1111
+ FileUtils.rm(bundled_app("Gemfile.lock"))
1112
+
1113
+ ruby <<-R
1114
+ require 'rubygems'
1115
+ require 'bundler'
1116
+
1117
+ begin
1118
+ Bundler.setup
1119
+ rescue Bundler::RubyVersionMismatch => e
1120
+ puts e.message
1121
+ end
1122
+ R
1123
+
1124
+ expect(bundled_app("Gemfile.lock")).not_to exist
1125
+ should_be_patchlevel_incorrect(:exitstatus => false)
1126
+ end
947
1127
  end
948
1128
 
949
1129
  context "bundle outdated" do
@@ -1054,5 +1234,25 @@ G
1054
1234
  should_be_engine_version_incorrect
1055
1235
  end
1056
1236
  end
1237
+
1238
+ it "fails when the patchlevel doesn't match" do
1239
+ simulate_ruby_engine "jruby" do
1240
+ update_repo2 do
1241
+ build_gem "activesupport", "3.0"
1242
+ update_git "foo", :path => lib_path("foo")
1243
+ end
1244
+
1245
+ gemfile <<-G
1246
+ source "file://#{gem_repo2}"
1247
+ gem "activesupport", "2.3.5"
1248
+ gem "foo", :git => "#{lib_path('foo')}"
1249
+
1250
+ #{patchlevel_incorrect}
1251
+ G
1252
+
1253
+ bundle "outdated", :exitstatus => true
1254
+ should_be_patchlevel_incorrect
1255
+ end
1256
+ end
1057
1257
  end
1058
1258
  end