bundler 1.7.15 → 1.8.0.pre

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 (191) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -14
  3. data/.rspec +1 -0
  4. data/.travis.yml +22 -15
  5. data/CHANGELOG.md +43 -13
  6. data/CODE_OF_CONDUCT.md +40 -0
  7. data/CONTRIBUTING.md +14 -12
  8. data/DEVELOPMENT.md +4 -2
  9. data/ISSUES.md +1 -1
  10. data/README.md +10 -14
  11. data/Rakefile +10 -10
  12. data/bin/bundle +1 -1
  13. data/bundler.gemspec +5 -4
  14. data/lib/bundler.rb +22 -3
  15. data/lib/bundler/anonymizable_uri.rb +24 -8
  16. data/lib/bundler/cli.rb +103 -66
  17. data/lib/bundler/cli/cache.rb +1 -0
  18. data/lib/bundler/cli/clean.rb +11 -4
  19. data/lib/bundler/cli/common.rb +2 -0
  20. data/lib/bundler/cli/console.rb +22 -26
  21. data/lib/bundler/cli/exec.rb +29 -22
  22. data/lib/bundler/cli/gem.rb +125 -37
  23. data/lib/bundler/cli/install.rb +22 -9
  24. data/lib/bundler/cli/outdated.rb +1 -1
  25. data/lib/bundler/cli/package.rb +8 -1
  26. data/lib/bundler/cli/show.rb +29 -3
  27. data/lib/bundler/cli/update.rb +2 -2
  28. data/lib/bundler/cli/viz.rb +1 -1
  29. data/lib/bundler/definition.rb +14 -22
  30. data/lib/bundler/dependency.rb +8 -1
  31. data/lib/bundler/dsl.rb +17 -4
  32. data/lib/bundler/endpoint_specification.rb +1 -1
  33. data/lib/bundler/env.rb +44 -25
  34. data/lib/bundler/fetcher.rb +33 -25
  35. data/lib/bundler/friendly_errors.rb +38 -5
  36. data/lib/bundler/gem_helper.rb +16 -10
  37. data/lib/bundler/gem_helpers.rb +1 -0
  38. data/lib/bundler/graph.rb +4 -1
  39. data/lib/bundler/index.rb +15 -25
  40. data/lib/bundler/installer.rb +6 -6
  41. data/lib/bundler/lockfile_parser.rb +7 -7
  42. data/lib/bundler/resolver.rb +2 -1
  43. data/lib/bundler/ruby_version.rb +1 -1
  44. data/lib/bundler/rubygems_ext.rb +1 -0
  45. data/lib/bundler/rubygems_integration.rb +1 -1
  46. data/lib/bundler/runtime.rb +22 -40
  47. data/lib/bundler/settings.rb +14 -5
  48. data/lib/bundler/setup.rb +2 -1
  49. data/lib/bundler/shared_helpers.rb +56 -4
  50. data/lib/bundler/source.rb +8 -9
  51. data/lib/bundler/source/git.rb +5 -1
  52. data/lib/bundler/source/git/git_proxy.rb +4 -0
  53. data/lib/bundler/source/path.rb +8 -11
  54. data/lib/bundler/source/path/installer.rb +0 -2
  55. data/lib/bundler/source/rubygems.rb +58 -72
  56. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +13 -0
  57. data/lib/bundler/templates/newgem/LICENSE.txt.tt +17 -18
  58. data/lib/bundler/templates/newgem/README.md.tt +9 -1
  59. data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
  60. data/lib/bundler/templates/newgem/bin/console.tt +14 -0
  61. data/lib/bundler/templates/newgem/bin/setup.tt +7 -0
  62. data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  63. data/lib/bundler/templates/newgem/gitignore.tt +2 -0
  64. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +1 -1
  65. data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -13
  66. data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +1 -1
  67. data/lib/bundler/ui/shell.rb +1 -1
  68. data/lib/bundler/version.rb +1 -1
  69. data/lib/bundler/worker.rb +73 -0
  70. data/man/bundle-config.ronn +17 -15
  71. data/man/bundle-install.ronn +102 -93
  72. data/man/bundle-update.ronn +39 -30
  73. data/man/bundle.ronn +6 -0
  74. data/man/gemfile.5.ronn +74 -13
  75. metadata +10 -231
  76. data/lib/bundler/parallel_workers.rb +0 -18
  77. data/lib/bundler/parallel_workers/thread_worker.rb +0 -30
  78. data/lib/bundler/parallel_workers/unix_worker.rb +0 -101
  79. data/lib/bundler/parallel_workers/worker.rb +0 -69
  80. data/lib/bundler/templates/newgem/bin/newgem.tt +0 -3
  81. data/spec/bundler/anonymizable_uri_spec.rb +0 -32
  82. data/spec/bundler/bundler_spec.rb +0 -72
  83. data/spec/bundler/cli_spec.rb +0 -16
  84. data/spec/bundler/definition_spec.rb +0 -22
  85. data/spec/bundler/dsl_spec.rb +0 -82
  86. data/spec/bundler/friendly_errors_spec.rb +0 -13
  87. data/spec/bundler/gem_helper_spec.rb +0 -226
  88. data/spec/bundler/psyched_yaml_spec.rb +0 -8
  89. data/spec/bundler/retry_spec.rb +0 -59
  90. data/spec/bundler/settings_spec.rb +0 -13
  91. data/spec/bundler/source/rubygems_spec.rb +0 -25
  92. data/spec/bundler/source_list_spec.rb +0 -361
  93. data/spec/cache/gems_spec.rb +0 -284
  94. data/spec/cache/git_spec.rb +0 -188
  95. data/spec/cache/path_spec.rb +0 -121
  96. data/spec/cache/platform_spec.rb +0 -57
  97. data/spec/commands/binstubs_spec.rb +0 -219
  98. data/spec/commands/check_spec.rb +0 -278
  99. data/spec/commands/clean_spec.rb +0 -592
  100. data/spec/commands/config_spec.rb +0 -263
  101. data/spec/commands/console_spec.rb +0 -76
  102. data/spec/commands/exec_spec.rb +0 -309
  103. data/spec/commands/help_spec.rb +0 -39
  104. data/spec/commands/init_spec.rb +0 -39
  105. data/spec/commands/inject_spec.rb +0 -78
  106. data/spec/commands/licenses_spec.rb +0 -18
  107. data/spec/commands/newgem_spec.rb +0 -428
  108. data/spec/commands/open_spec.rb +0 -68
  109. data/spec/commands/outdated_spec.rb +0 -156
  110. data/spec/commands/package_spec.rb +0 -114
  111. data/spec/commands/show_spec.rb +0 -125
  112. data/spec/install/binstubs_spec.rb +0 -24
  113. data/spec/install/bundler_spec.rb +0 -146
  114. data/spec/install/deploy_spec.rb +0 -250
  115. data/spec/install/gemfile/gemspec_spec.rb +0 -170
  116. data/spec/install/gemfile/git_spec.rb +0 -967
  117. data/spec/install/gemfile/path_spec.rb +0 -500
  118. data/spec/install/gemfile_spec.rb +0 -44
  119. data/spec/install/gems/c_ext_spec.rb +0 -48
  120. data/spec/install/gems/dependency_api_spec.rb +0 -652
  121. data/spec/install/gems/env_spec.rb +0 -107
  122. data/spec/install/gems/flex_spec.rb +0 -314
  123. data/spec/install/gems/groups_spec.rb +0 -308
  124. data/spec/install/gems/mirror_spec.rb +0 -39
  125. data/spec/install/gems/platform_spec.rb +0 -195
  126. data/spec/install/gems/post_install_spec.rb +0 -121
  127. data/spec/install/gems/resolving_spec.rb +0 -124
  128. data/spec/install/gems/simple_case_spec.rb +0 -377
  129. data/spec/install/gems/sources_spec.rb +0 -386
  130. data/spec/install/gems/standalone_spec.rb +0 -260
  131. data/spec/install/gems/sudo_spec.rb +0 -136
  132. data/spec/install/gems/win32_spec.rb +0 -26
  133. data/spec/install/gemspecs_spec.rb +0 -50
  134. data/spec/install/path_spec.rb +0 -150
  135. data/spec/install/post_bundle_message_spec.rb +0 -142
  136. data/spec/install/prereleases_spec.rb +0 -43
  137. data/spec/install/security_policy_spec.rb +0 -77
  138. data/spec/install/upgrade_spec.rb +0 -26
  139. data/spec/lock/git_spec.rb +0 -34
  140. data/spec/lock/lockfile_spec.rb +0 -924
  141. data/spec/other/bundle_ruby_spec.rb +0 -142
  142. data/spec/other/cli_dispatch_spec.rb +0 -21
  143. data/spec/other/ext_spec.rb +0 -60
  144. data/spec/other/platform_spec.rb +0 -1285
  145. data/spec/other/ssl_cert_spec.rb +0 -23
  146. data/spec/quality_spec.rb +0 -88
  147. data/spec/realworld/dependency_api_spec.rb +0 -60
  148. data/spec/realworld/edgecases_spec.rb +0 -212
  149. data/spec/realworld/parallel_spec.rb +0 -71
  150. data/spec/resolver/basic_spec.rb +0 -66
  151. data/spec/resolver/platform_spec.rb +0 -88
  152. data/spec/runtime/executable_spec.rb +0 -149
  153. data/spec/runtime/load_spec.rb +0 -107
  154. data/spec/runtime/platform_spec.rb +0 -90
  155. data/spec/runtime/require_spec.rb +0 -332
  156. data/spec/runtime/setup_spec.rb +0 -853
  157. data/spec/runtime/with_clean_env_spec.rb +0 -91
  158. data/spec/spec_helper.rb +0 -123
  159. data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +0 -13
  160. data/spec/support/artifice/endpoint.rb +0 -71
  161. data/spec/support/artifice/endpoint_500.rb +0 -37
  162. data/spec/support/artifice/endpoint_api_forbidden.rb +0 -11
  163. data/spec/support/artifice/endpoint_api_missing.rb +0 -16
  164. data/spec/support/artifice/endpoint_basic_authentication.rb +0 -13
  165. data/spec/support/artifice/endpoint_creds_diff_host.rb +0 -38
  166. data/spec/support/artifice/endpoint_extra.rb +0 -31
  167. data/spec/support/artifice/endpoint_extra_api.rb +0 -32
  168. data/spec/support/artifice/endpoint_extra_missing.rb +0 -15
  169. data/spec/support/artifice/endpoint_fallback.rb +0 -17
  170. data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
  171. data/spec/support/artifice/endpoint_marshal_fail.rb +0 -11
  172. data/spec/support/artifice/endpoint_redirect.rb +0 -15
  173. data/spec/support/artifice/endpoint_strict_basic_authentication.rb +0 -18
  174. data/spec/support/artifice/endpoint_timeout.rb +0 -13
  175. data/spec/support/builders.rb +0 -693
  176. data/spec/support/fakeweb/rack-1.0.0.marshal +0 -2
  177. data/spec/support/fakeweb/windows.rb +0 -23
  178. data/spec/support/hax.rb +0 -22
  179. data/spec/support/helpers.rb +0 -361
  180. data/spec/support/indexes.rb +0 -280
  181. data/spec/support/matchers.rb +0 -77
  182. data/spec/support/path.rb +0 -85
  183. data/spec/support/permissions.rb +0 -10
  184. data/spec/support/platforms.rb +0 -94
  185. data/spec/support/ruby_ext.rb +0 -20
  186. data/spec/support/rubygems_ext.rb +0 -39
  187. data/spec/support/streams.rb +0 -13
  188. data/spec/support/sudo.rb +0 -16
  189. data/spec/update/gems_spec.rb +0 -201
  190. data/spec/update/git_spec.rb +0 -283
  191. data/spec/update/path_spec.rb +0 -18
@@ -1,142 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle_ruby" do
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'
9
-
10
- gem "foo"
11
- G
12
-
13
- bundle_ruby
14
-
15
- expect(out).to eq("ruby 1.9.3")
16
- end
17
-
18
- it "engine defaults to MRI" do
19
- gemfile <<-G
20
- source "file://#{gem_repo1}"
21
- ruby "1.9.3"
22
-
23
- gem "foo"
24
- G
25
-
26
- bundle_ruby
27
-
28
- expect(out).to eq("ruby 1.9.3")
29
- end
30
-
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'
35
-
36
- gem "foo"
37
- G
38
-
39
- bundle_ruby
40
-
41
- expect(out).to eq("ruby 1.8.7 (jruby 1.6.5)")
42
- end
43
-
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'
48
-
49
- gem "foo"
50
- G
51
-
52
- bundle_ruby
53
-
54
- expect(out).to eq("ruby 1.8.7 (rbx 1.2.4)")
55
- end
56
-
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'
61
-
62
- gem "foo"
63
- G
64
-
65
- bundle_ruby :exitstatus => true
66
- expect(exitstatus).not_to eq(0)
67
-
68
- bundle_ruby
69
- expect(out).to eq("Please define :engine_version")
70
- end
71
-
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'
76
-
77
- gem "foo"
78
- G
79
-
80
- bundle_ruby :exitstatus => true
81
- expect(exitstatus).not_to eq(0)
82
-
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'
91
-
92
- gem "foo"
93
- G
94
-
95
- bundle_ruby :exitstatus => true
96
- expect(exitstatus).not_to eq(0)
97
-
98
- bundle_ruby
99
- expect(out).to eq("ruby_version must match the :engine_version for MRI")
100
- end
101
-
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
113
- end
114
-
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'
133
-
134
- gem "foo"
135
- G
136
-
137
- bundle_ruby
138
-
139
- expect(out).to eq("ruby 1.9.3p392 (jruby 1.7.4)")
140
- end
141
- end
142
- end
@@ -1,21 +0,0 @@
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
@@ -1,60 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Gem::Specification#match_platform" do
4
- it "does not match platforms other than the gem platform" do
5
- darwin = gem "lol", "1.0", "platform_specific-1.0-x86-darwin-10"
6
- expect(darwin.match_platform(pl('java'))).to eq(false)
7
- end
8
- end
9
-
10
- describe "Bundler::GemHelpers#generic" do
11
- include Bundler::GemHelpers
12
-
13
- it "converts non-windows platforms into ruby" do
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'))
38
- end
39
- end
40
-
41
- describe "Gem::SourceIndex#refresh!" do
42
- rubygems_1_7 = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.7.0")
43
-
44
- before do
45
- install_gemfile <<-G
46
- source "file://#{gem_repo1}"
47
- gem "rack"
48
- G
49
- end
50
-
51
- it "does not explode when called", :if => rubygems_1_7 do
52
- run "Gem.source_index.refresh!"
53
- run "Gem::SourceIndex.new([]).refresh!"
54
- end
55
-
56
- it "does not explode when called", :unless => rubygems_1_7 do
57
- run "Gem.source_index.refresh!"
58
- run "Gem::SourceIndex.from_gems_in([]).refresh!"
59
- end
60
- end
@@ -1,1285 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle platform" do
4
- context "without flags" do
5
- it "returns all the output" do
6
- gemfile <<-G
7
- source "file://#{gem_repo1}"
8
-
9
- #{ruby_version_correct}
10
-
11
- gem "foo"
12
- G
13
-
14
- bundle "platform"
15
- expect(out).to eq(<<-G.chomp)
16
- Your platform is: #{RUBY_PLATFORM}
17
-
18
- Your app has gems that work on these platforms:
19
- * ruby
20
-
21
- Your Gemfile specifies a Ruby version requirement:
22
- * ruby #{RUBY_VERSION}
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
-
47
- Your current platform satisfies the Ruby version requirement.
48
- G
49
- end
50
-
51
- it "doesn't print ruby version requirement if it isn't specified" do
52
- gemfile <<-G
53
- source "file://#{gem_repo1}"
54
-
55
- gem "foo"
56
- G
57
-
58
- bundle "platform"
59
- expect(out).to eq(<<-G.chomp)
60
- Your platform is: #{RUBY_PLATFORM}
61
-
62
- Your app has gems that work on these platforms:
63
- * ruby
64
-
65
- Your Gemfile does not specify a Ruby version requirement.
66
- G
67
- end
68
-
69
- it "doesn't match the ruby version requirement" do
70
- gemfile <<-G
71
- source "file://#{gem_repo1}"
72
-
73
- #{ruby_version_incorrect}
74
-
75
- gem "foo"
76
- G
77
-
78
- bundle "platform"
79
- expect(out).to eq(<<-G.chomp)
80
- Your platform is: #{RUBY_PLATFORM}
81
-
82
- Your app has gems that work on these platforms:
83
- * ruby
84
-
85
- Your Gemfile specifies a Ruby version requirement:
86
- * ruby #{not_local_ruby_version}
87
-
88
- Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}
89
- G
90
- end
91
- end
92
-
93
- context "--ruby" do
94
- it "returns ruby version when explicit" do
95
- gemfile <<-G
96
- source "file://#{gem_repo1}"
97
- ruby "1.9.3", :engine => 'ruby', :engine_version => '1.9.3'
98
-
99
- gem "foo"
100
- G
101
-
102
- bundle "platform --ruby"
103
-
104
- expect(out).to eq("ruby 1.9.3")
105
- end
106
-
107
- it "defaults to MRI" do
108
- gemfile <<-G
109
- source "file://#{gem_repo1}"
110
- ruby "1.9.3"
111
-
112
- gem "foo"
113
- G
114
-
115
- bundle "platform --ruby"
116
-
117
- expect(out).to eq("ruby 1.9.3")
118
- end
119
-
120
- it "handles jruby" do
121
- gemfile <<-G
122
- source "file://#{gem_repo1}"
123
- ruby "1.8.7", :engine => 'jruby', :engine_version => '1.6.5'
124
-
125
- gem "foo"
126
- G
127
-
128
- bundle "platform --ruby"
129
-
130
- expect(out).to eq("ruby 1.8.7 (jruby 1.6.5)")
131
- end
132
-
133
- it "handles rbx" do
134
- gemfile <<-G
135
- source "file://#{gem_repo1}"
136
- ruby "1.8.7", :engine => 'rbx', :engine_version => '1.2.4'
137
-
138
- gem "foo"
139
- G
140
-
141
- bundle "platform --ruby"
142
-
143
- expect(out).to eq("ruby 1.8.7 (rbx 1.2.4)")
144
- end
145
-
146
- it "raises an error if engine is used but engine version is not" do
147
- gemfile <<-G
148
- source "file://#{gem_repo1}"
149
- ruby "1.8.7", :engine => 'rbx'
150
-
151
- gem "foo"
152
- G
153
-
154
- bundle "platform", :exitstatus => true
155
-
156
- expect(exitstatus).not_to eq(0)
157
- end
158
-
159
- it "raises an error if engine_version is used but engine is not" do
160
- gemfile <<-G
161
- source "file://#{gem_repo1}"
162
- ruby "1.8.7", :engine_version => '1.2.4'
163
-
164
- gem "foo"
165
- G
166
-
167
- bundle "platform", :exitstatus => true
168
-
169
- expect(exitstatus).not_to eq(0)
170
- end
171
-
172
- it "raises an error if engine version doesn't match ruby version for MRI" do
173
- gemfile <<-G
174
- source "file://#{gem_repo1}"
175
- ruby "1.8.7", :engine => 'ruby', :engine_version => '1.2.4'
176
-
177
- gem "foo"
178
- G
179
-
180
- bundle "platform", :exitstatus => true
181
-
182
- expect(exitstatus).not_to eq(0)
183
- end
184
-
185
- it "should print if no ruby version is specified" do
186
- gemfile <<-G
187
- source "file://#{gem_repo1}"
188
-
189
- gem "foo"
190
- G
191
-
192
- bundle "platform --ruby"
193
- puts err
194
-
195
- expect(out).to eq("No ruby version specified")
196
- end
197
- end
198
-
199
- let(:ruby_version_correct) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{local_engine_version}\"" }
200
- let(:ruby_version_correct_engineless) { "ruby \"#{RUBY_VERSION}\"" }
201
- let(:ruby_version_correct_patchlevel) { "#{ruby_version_correct}, :patchlevel => '#{RUBY_PATCHLEVEL}'" }
202
- let(:ruby_version_incorrect) { "ruby \"#{not_local_ruby_version}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{not_local_ruby_version}\"" }
203
- let(:engine_incorrect) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{not_local_tag}\", :engine_version => \"#{RUBY_VERSION}\"" }
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}'" }
206
- let(:patchlevel_fixnum) { "#{ruby_version_correct}, :patchlevel => #{RUBY_PATCHLEVEL}1" }
207
-
208
- def should_be_ruby_version_incorrect(opts = {:exitstatus => true})
209
- expect(exitstatus).to eq(18) if opts[:exitstatus]
210
- expect(out).to be_include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}")
211
- end
212
-
213
- def should_be_engine_incorrect(opts = {:exitstatus => true})
214
- expect(exitstatus).to eq(18) if opts[:exitstatus]
215
- expect(out).to be_include("Your Ruby engine is #{local_ruby_engine}, but your Gemfile specified #{not_local_tag}")
216
- end
217
-
218
- def should_be_engine_version_incorrect(opts = {:exitstatus => true})
219
- expect(exitstatus).to eq(18) if opts[:exitstatus]
220
- 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}")
221
- end
222
-
223
- def should_be_patchlevel_incorrect(opts = {:exitstatus => true})
224
- expect(exitstatus).to eq(18) if opts[:exitstatus]
225
-
226
- expect(out).to be_include("Your Ruby patchlevel is #{RUBY_PATCHLEVEL}, but your Gemfile specified #{not_local_patchlevel}")
227
- end
228
-
229
- def should_be_patchlevel_fixnum(opts = {:exitstatus => true})
230
- expect(exitstatus).to eq(18) if opts[:exitstatus]
231
-
232
- expect(out).to be_include("The Ruby patchlevel in your Gemfile must be a string")
233
- end
234
-
235
- context "bundle install" do
236
- it "installs fine when the ruby version matches" do
237
- install_gemfile <<-G
238
- source "file://#{gem_repo1}"
239
- gem "rack"
240
-
241
- #{ruby_version_correct}
242
- G
243
-
244
- expect(bundled_app('Gemfile.lock')).to exist
245
- end
246
-
247
- it "installs fine with any engine" do
248
- simulate_ruby_engine "jruby" do
249
- install_gemfile <<-G
250
- source "file://#{gem_repo1}"
251
- gem "rack"
252
-
253
- #{ruby_version_correct_engineless}
254
- G
255
-
256
- expect(bundled_app('Gemfile.lock')).to exist
257
- end
258
- end
259
-
260
- it "installs fine when the patchlevel matches" do
261
- install_gemfile <<-G
262
- source "file://#{gem_repo1}"
263
- gem "rack"
264
-
265
- #{ruby_version_correct_patchlevel}
266
- G
267
-
268
- expect(bundled_app('Gemfile.lock')).to exist
269
- end
270
-
271
- it "doesn't install when the ruby version doesn't match" do
272
- install_gemfile <<-G, :exitstatus => true
273
- source "file://#{gem_repo1}"
274
- gem "rack"
275
-
276
- #{ruby_version_incorrect}
277
- G
278
-
279
- expect(bundled_app('Gemfile.lock')).not_to exist
280
- should_be_ruby_version_incorrect
281
- end
282
-
283
- it "doesn't install when engine doesn't match" do
284
- install_gemfile <<-G, :exitstatus => true
285
- source "file://#{gem_repo1}"
286
- gem "rack"
287
-
288
- #{engine_incorrect}
289
- G
290
-
291
- expect(bundled_app('Gemfile.lock')).not_to exist
292
- should_be_engine_incorrect
293
- end
294
-
295
- it "doesn't install when engine version doesn't match" do
296
- simulate_ruby_engine "jruby" do
297
- install_gemfile <<-G, :exitstatus => true
298
- source "file://#{gem_repo1}"
299
- gem "rack"
300
-
301
- #{engine_version_incorrect}
302
- G
303
-
304
- expect(bundled_app('Gemfile.lock')).not_to exist
305
- should_be_engine_version_incorrect
306
- end
307
- end
308
-
309
- it "doesn't install when patchlevel doesn't match" do
310
- install_gemfile <<-G, :exitstatus => true
311
- source "file://#{gem_repo1}"
312
- gem "rack"
313
-
314
- #{patchlevel_incorrect}
315
- G
316
-
317
- expect(bundled_app('Gemfile.lock')).not_to exist
318
- should_be_patchlevel_incorrect
319
- end
320
- end
321
-
322
- context "bundle check" do
323
- it "checks fine when the ruby version matches" do
324
- install_gemfile <<-G
325
- source "file://#{gem_repo1}"
326
- gem "rack"
327
- G
328
-
329
- gemfile <<-G
330
- source "file://#{gem_repo1}"
331
- gem "rack"
332
-
333
- #{ruby_version_correct}
334
- G
335
-
336
- bundle :check, :exitstatus => true
337
- expect(exitstatus).to eq(0)
338
- expect(out).to eq("The Gemfile's dependencies are satisfied")
339
- end
340
-
341
- it "checks fine with any engine" do
342
- simulate_ruby_engine "jruby" do
343
- install_gemfile <<-G
344
- source "file://#{gem_repo1}"
345
- gem "rack"
346
- G
347
-
348
- gemfile <<-G
349
- source "file://#{gem_repo1}"
350
- gem "rack"
351
-
352
- #{ruby_version_correct_engineless}
353
- G
354
-
355
- bundle :check, :exitstatus => true
356
- expect(exitstatus).to eq(0)
357
- expect(out).to eq("The Gemfile's dependencies are satisfied")
358
- end
359
- end
360
-
361
- it "fails when ruby version doesn't match" do
362
- install_gemfile <<-G
363
- source "file://#{gem_repo1}"
364
- gem "rack"
365
- G
366
-
367
- gemfile <<-G
368
- source "file://#{gem_repo1}"
369
- gem "rack"
370
-
371
- #{ruby_version_incorrect}
372
- G
373
-
374
- bundle :check, :exitstatus => true
375
- should_be_ruby_version_incorrect
376
- end
377
-
378
- it "fails when engine doesn't match" do
379
- install_gemfile <<-G
380
- source "file://#{gem_repo1}"
381
- gem "rack"
382
- G
383
-
384
- gemfile <<-G
385
- source "file://#{gem_repo1}"
386
- gem "rack"
387
-
388
- #{engine_incorrect}
389
- G
390
-
391
- bundle :check, :exitstatus => true
392
- should_be_engine_incorrect
393
- end
394
-
395
- it "fails when engine version doesn't match" do
396
- simulate_ruby_engine "ruby" do
397
- install_gemfile <<-G
398
- source "file://#{gem_repo1}"
399
- gem "rack"
400
- G
401
-
402
- gemfile <<-G
403
- source "file://#{gem_repo1}"
404
- gem "rack"
405
-
406
- #{engine_version_incorrect}
407
- G
408
-
409
- bundle :check, :exitstatus => true
410
- should_be_engine_version_incorrect
411
- end
412
- end
413
-
414
- it "fails when patchlevel doesn't match" do
415
- install_gemfile <<-G, :exitstatus => true
416
- source "file://#{gem_repo1}"
417
- gem "rack"
418
- G
419
-
420
- gemfile <<-G
421
- source "file://#{gem_repo1}"
422
- gem "rack"
423
-
424
- #{patchlevel_incorrect}
425
- G
426
-
427
- bundle :check, :exitstatus => true
428
- should_be_patchlevel_incorrect
429
- end
430
- end
431
-
432
- context "bundle update" do
433
- before do
434
- build_repo2
435
-
436
- install_gemfile <<-G
437
- source "file://#{gem_repo2}"
438
- gem "activesupport"
439
- gem "rack-obama"
440
- G
441
- end
442
-
443
- it "updates successfully when the ruby version matches" do
444
- gemfile <<-G
445
- source "file://#{gem_repo2}"
446
- gem "activesupport"
447
- gem "rack-obama"
448
-
449
- #{ruby_version_correct}
450
- G
451
- update_repo2 do
452
- build_gem "activesupport", "3.0"
453
- end
454
-
455
- bundle "update"
456
- should_be_installed "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
457
- end
458
-
459
- it "updates fine with any engine" do
460
- simulate_ruby_engine "jruby" do
461
- gemfile <<-G
462
- source "file://#{gem_repo2}"
463
- gem "activesupport"
464
- gem "rack-obama"
465
-
466
- #{ruby_version_correct_engineless}
467
- G
468
- update_repo2 do
469
- build_gem "activesupport", "3.0"
470
- end
471
-
472
- bundle "update"
473
- should_be_installed "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
474
- end
475
- end
476
-
477
- it "fails when ruby version doesn't match" do
478
- gemfile <<-G
479
- source "file://#{gem_repo2}"
480
- gem "activesupport"
481
- gem "rack-obama"
482
-
483
- #{ruby_version_incorrect}
484
- G
485
- update_repo2 do
486
- build_gem "activesupport", "3.0"
487
- end
488
-
489
- bundle :update, :exitstatus => true
490
- should_be_ruby_version_incorrect
491
- end
492
-
493
- it "fails when ruby engine doesn't match" do
494
- gemfile <<-G
495
- source "file://#{gem_repo2}"
496
- gem "activesupport"
497
- gem "rack-obama"
498
-
499
- #{engine_incorrect}
500
- G
501
- update_repo2 do
502
- build_gem "activesupport", "3.0"
503
- end
504
-
505
- bundle :update, :exitstatus => true
506
- should_be_engine_incorrect
507
- end
508
-
509
- it "fails when ruby engine version doesn't match" do
510
- simulate_ruby_engine "jruby" do
511
- gemfile <<-G
512
- source "file://#{gem_repo2}"
513
- gem "activesupport"
514
- gem "rack-obama"
515
-
516
- #{engine_version_incorrect}
517
- G
518
- update_repo2 do
519
- build_gem "activesupport", "3.0"
520
- end
521
-
522
- bundle :update, :exitstatus => true
523
- should_be_engine_version_incorrect
524
- end
525
- end
526
-
527
- it "fails when patchlevel doesn't match" do
528
- gemfile <<-G, :exitstatus => true
529
- source "file://#{gem_repo1}"
530
- gem "rack"
531
-
532
- #{patchlevel_incorrect}
533
- G
534
- update_repo2 do
535
- build_gem "activesupport", "3.0"
536
- end
537
-
538
- bundle :update, :exitstatus => true
539
- should_be_patchlevel_incorrect
540
- end
541
- end
542
-
543
- context "bundle show" do
544
- before do
545
- install_gemfile <<-G
546
- source "file://#{gem_repo1}"
547
- gem "rails"
548
- G
549
- end
550
-
551
- it "prints path if ruby version is correct" do
552
- gemfile <<-G
553
- source "file://#{gem_repo1}"
554
- gem "rails"
555
-
556
- #{ruby_version_correct}
557
- G
558
-
559
- bundle "show rails"
560
- expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
561
- end
562
-
563
- it "prints path if ruby version is correct for any engine" do
564
- simulate_ruby_engine "jruby" do
565
- gemfile <<-G
566
- source "file://#{gem_repo1}"
567
- gem "rails"
568
-
569
- #{ruby_version_correct_engineless}
570
- G
571
-
572
- bundle "show rails"
573
- expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
574
- end
575
- end
576
-
577
- it "fails if ruby version doesn't match" do
578
- gemfile <<-G
579
- source "file://#{gem_repo1}"
580
- gem "rails"
581
-
582
- #{ruby_version_incorrect}
583
- G
584
-
585
- bundle "show rails", :exitstatus => true
586
- should_be_ruby_version_incorrect
587
- end
588
-
589
- it "fails if engine doesn't match" do
590
- gemfile <<-G
591
- source "file://#{gem_repo1}"
592
- gem "rails"
593
-
594
- #{engine_incorrect}
595
- G
596
-
597
- bundle "show rails", :exitstatus => true
598
- should_be_engine_incorrect
599
- end
600
-
601
- it "fails if engine version doesn't match" do
602
- simulate_ruby_engine "jruby" do
603
- gemfile <<-G
604
- source "file://#{gem_repo1}"
605
- gem "rails"
606
-
607
- #{engine_version_incorrect}
608
- G
609
-
610
- bundle "show rails", :exitstatus => true
611
- should_be_engine_version_incorrect
612
- end
613
- end
614
-
615
- it "fails when patchlevel doesn't match" do
616
- gemfile <<-G, :exitstatus => true
617
- source "file://#{gem_repo1}"
618
- gem "rack"
619
-
620
- #{patchlevel_incorrect}
621
- G
622
- update_repo2 do
623
- build_gem "activesupport", "3.0"
624
- end
625
-
626
- bundle "show rails", :exitstatus => true
627
- should_be_patchlevel_incorrect
628
- end
629
- end
630
-
631
- context "bundle cache" do
632
- before do
633
- gemfile <<-G
634
- gem 'rack'
635
- G
636
-
637
- system_gems "rack-1.0.0"
638
- end
639
-
640
- it "copies the .gem file to vendor/cache when ruby version matches" do
641
- gemfile <<-G
642
- gem 'rack'
643
-
644
- #{ruby_version_correct}
645
- G
646
-
647
- bundle :cache
648
- expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
649
- end
650
-
651
- it "copies the .gem file to vendor/cache when ruby version matches for any engine" do
652
- simulate_ruby_engine "jruby" do
653
- gemfile <<-G
654
- gem 'rack'
655
-
656
- #{ruby_version_correct_engineless}
657
- G
658
-
659
- bundle :cache
660
- expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
661
- end
662
- end
663
-
664
- it "fails if the ruby version doesn't match" do
665
- gemfile <<-G
666
- gem 'rack'
667
-
668
- #{ruby_version_incorrect}
669
- G
670
-
671
- bundle :cache, :exitstatus => true
672
- should_be_ruby_version_incorrect
673
- end
674
-
675
- it "fails if the engine doesn't match" do
676
- gemfile <<-G
677
- gem 'rack'
678
-
679
- #{engine_incorrect}
680
- G
681
-
682
- bundle :cache, :exitstatus => true
683
- should_be_engine_incorrect
684
- end
685
-
686
- it "fails if the engine version doesn't match" do
687
- simulate_ruby_engine "jruby" do
688
- gemfile <<-G
689
- gem 'rack'
690
-
691
- #{engine_version_incorrect}
692
- G
693
-
694
- bundle :cache, :exitstatus => true
695
- should_be_engine_version_incorrect
696
- end
697
- end
698
-
699
- it "fails when patchlevel doesn't match" do
700
- gemfile <<-G, :exitstatus => true
701
- source "file://#{gem_repo1}"
702
- gem "rack"
703
-
704
- #{patchlevel_incorrect}
705
- G
706
-
707
- bundle :cache, :exitstatus => true
708
- should_be_patchlevel_incorrect
709
- end
710
- end
711
-
712
- context "bundle pack" do
713
- before do
714
- gemfile <<-G
715
- gem 'rack'
716
- G
717
-
718
- system_gems "rack-1.0.0"
719
- end
720
-
721
- it "copies the .gem file to vendor/cache when ruby version matches" do
722
- gemfile <<-G
723
- gem 'rack'
724
-
725
- #{ruby_version_correct}
726
- G
727
-
728
- bundle :pack
729
- expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
730
- end
731
-
732
- it "copies the .gem file to vendor/cache when ruby version matches any engine" do
733
- simulate_ruby_engine "jruby" do
734
- gemfile <<-G
735
- gem 'rack'
736
-
737
- #{ruby_version_correct_engineless}
738
- G
739
-
740
- bundle :pack
741
- expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
742
- end
743
- end
744
-
745
- it "fails if the ruby version doesn't match" do
746
- gemfile <<-G
747
- gem 'rack'
748
-
749
- #{ruby_version_incorrect}
750
- G
751
-
752
- bundle :pack, :exitstatus => true
753
- should_be_ruby_version_incorrect
754
- end
755
-
756
- it "fails if the engine doesn't match" do
757
- gemfile <<-G
758
- gem 'rack'
759
-
760
- #{engine_incorrect}
761
- G
762
-
763
- bundle :pack, :exitstatus => true
764
- should_be_engine_incorrect
765
- end
766
-
767
- it "fails if the engine version doesn't match" do
768
- simulate_ruby_engine "jruby" do
769
- gemfile <<-G
770
- gem 'rack'
771
-
772
- #{engine_version_incorrect}
773
- G
774
-
775
- bundle :pack, :exitstatus => true
776
- should_be_engine_version_incorrect
777
- end
778
- end
779
-
780
- it "fails when patchlevel doesn't match" do
781
- gemfile <<-G, :exitstatus => true
782
- source "file://#{gem_repo1}"
783
- gem "rack"
784
-
785
- #{patchlevel_incorrect}
786
- G
787
-
788
- bundle :pack, :exitstatus => true
789
- should_be_patchlevel_incorrect
790
- end
791
- end
792
-
793
- context "bundle exec" do
794
- before do
795
- system_gems "rack-1.0.0", "rack-0.9.1"
796
- end
797
-
798
- it "activates the correct gem when ruby version matches" do
799
- gemfile <<-G
800
- gem "rack", "0.9.1"
801
-
802
- #{ruby_version_correct}
803
- G
804
-
805
- bundle "exec rackup"
806
- expect(out).to eq("0.9.1")
807
- end
808
-
809
- it "activates the correct gem when ruby version matches any engine" do
810
- simulate_ruby_engine "jruby" do
811
- gemfile <<-G
812
- gem "rack", "0.9.1"
813
-
814
- #{ruby_version_correct_engineless}
815
- G
816
-
817
- bundle "exec rackup"
818
- expect(out).to eq("0.9.1")
819
- end
820
- end
821
-
822
- it "fails when the ruby version doesn't match" do
823
- gemfile <<-G
824
- gem "rack", "0.9.1"
825
-
826
- #{ruby_version_incorrect}
827
- G
828
-
829
- bundle "exec rackup", :exitstatus => true
830
- should_be_ruby_version_incorrect
831
- end
832
-
833
- it "fails when the engine doesn't match" do
834
- gemfile <<-G
835
- gem "rack", "0.9.1"
836
-
837
- #{engine_incorrect}
838
- G
839
-
840
- bundle "exec rackup", :exitstatus => true
841
- should_be_engine_incorrect
842
- end
843
-
844
- it "fails when the engine version doesn't match" do
845
- simulate_ruby_engine "jruby" do
846
- gemfile <<-G
847
- gem "rack", "0.9.1"
848
-
849
- #{engine_version_incorrect}
850
- G
851
-
852
- bundle "exec rackup", :exitstatus => true
853
- should_be_engine_version_incorrect
854
- end
855
- end
856
-
857
- it "fails when patchlevel doesn't match" do
858
- gemfile <<-G, :exitstatus => true
859
- source "file://#{gem_repo1}"
860
- gem "rack"
861
-
862
- #{patchlevel_incorrect}
863
- G
864
-
865
- bundle "exec rackup", :exitstatus => true
866
- should_be_patchlevel_incorrect
867
- end
868
- end
869
-
870
- context "bundle console" do
871
- before do
872
- install_gemfile <<-G
873
- source "file://#{gem_repo1}"
874
- gem "rack"
875
- gem "activesupport", :group => :test
876
- gem "rack_middleware", :group => :development
877
- G
878
- end
879
-
880
- it "starts IRB with the default group loaded when ruby version matches" do
881
- gemfile <<-G
882
- source "file://#{gem_repo1}"
883
- gem "rack"
884
- gem "activesupport", :group => :test
885
- gem "rack_middleware", :group => :development
886
-
887
- #{ruby_version_correct}
888
- G
889
-
890
- bundle "console" do |input|
891
- input.puts("puts RACK")
892
- input.puts("exit")
893
- end
894
- expect(out).to include("0.9.1")
895
- end
896
-
897
- it "starts IRB with the default group loaded when ruby version matches any engine" do
898
- simulate_ruby_engine "jruby" do
899
- gemfile <<-G
900
- source "file://#{gem_repo1}"
901
- gem "rack"
902
- gem "activesupport", :group => :test
903
- gem "rack_middleware", :group => :development
904
-
905
- #{ruby_version_correct_engineless}
906
- G
907
-
908
- bundle "console" do |input|
909
- input.puts("puts RACK")
910
- input.puts("exit")
911
- end
912
- expect(out).to include("0.9.1")
913
- end
914
- end
915
-
916
- it "fails when ruby version doesn't match" do
917
- gemfile <<-G
918
- source "file://#{gem_repo1}"
919
- gem "rack"
920
- gem "activesupport", :group => :test
921
- gem "rack_middleware", :group => :development
922
-
923
- #{ruby_version_incorrect}
924
- G
925
-
926
- bundle "console", :exitstatus => true
927
- should_be_ruby_version_incorrect
928
- end
929
-
930
- it "fails when engine doesn't match" do
931
- gemfile <<-G
932
- source "file://#{gem_repo1}"
933
- gem "rack"
934
- gem "activesupport", :group => :test
935
- gem "rack_middleware", :group => :development
936
-
937
- #{engine_incorrect}
938
- G
939
-
940
- bundle "console", :exitstatus => true
941
- should_be_engine_incorrect
942
- end
943
-
944
- it "fails when engine version doesn't match" do
945
- simulate_ruby_engine "jruby" do
946
- gemfile <<-G
947
- source "file://#{gem_repo1}"
948
- gem "rack"
949
- gem "activesupport", :group => :test
950
- gem "rack_middleware", :group => :development
951
-
952
- #{engine_version_incorrect}
953
- G
954
-
955
- bundle "console", :exitstatus => true
956
- should_be_engine_version_incorrect
957
- end
958
- end
959
-
960
- it "fails when patchlevel doesn't match" do
961
- gemfile <<-G, :exitstatus => true
962
- source "file://#{gem_repo1}"
963
- gem "rack"
964
- gem "activesupport", :group => :test
965
- gem "rack_middleware", :group => :development
966
-
967
- #{patchlevel_incorrect}
968
- G
969
-
970
- bundle "console", :exitstatus => true
971
- should_be_patchlevel_incorrect
972
- end
973
- end
974
-
975
- context "Bundler.setup" do
976
- before do
977
- install_gemfile <<-G
978
- source "file://#{gem_repo1}"
979
- gem "yard"
980
- gem "rack", :group => :test
981
- G
982
- end
983
-
984
- it "makes a Gemfile.lock if setup succeeds" do
985
- install_gemfile <<-G
986
- source "file://#{gem_repo1}"
987
- gem "yard"
988
- gem "rack"
989
-
990
- #{ruby_version_correct}
991
- G
992
-
993
- File.read(bundled_app("Gemfile.lock"))
994
-
995
- FileUtils.rm(bundled_app("Gemfile.lock"))
996
-
997
- run "1"
998
- expect(bundled_app("Gemfile.lock")).to exist
999
- end
1000
-
1001
- it "makes a Gemfile.lock if setup succeeds for any engine" do
1002
- simulate_ruby_engine "jruby" do
1003
- install_gemfile <<-G
1004
- source "file://#{gem_repo1}"
1005
- gem "yard"
1006
- gem "rack"
1007
-
1008
- #{ruby_version_correct_engineless}
1009
- G
1010
-
1011
- File.read(bundled_app("Gemfile.lock"))
1012
-
1013
- FileUtils.rm(bundled_app("Gemfile.lock"))
1014
-
1015
- run "1"
1016
- expect(bundled_app("Gemfile.lock")).to exist
1017
- end
1018
- end
1019
-
1020
- it "fails when ruby version doesn't match" do
1021
- install_gemfile <<-G
1022
- source "file://#{gem_repo1}"
1023
- gem "yard"
1024
- gem "rack"
1025
-
1026
- #{ruby_version_incorrect}
1027
- G
1028
-
1029
- File.read(bundled_app("Gemfile.lock"))
1030
-
1031
- FileUtils.rm(bundled_app("Gemfile.lock"))
1032
-
1033
- ruby <<-R
1034
- require 'rubygems'
1035
- require 'bundler'
1036
-
1037
- begin
1038
- Bundler.setup
1039
- rescue Bundler::RubyVersionMismatch => e
1040
- puts e.message
1041
- end
1042
- R
1043
-
1044
- expect(bundled_app("Gemfile.lock")).not_to exist
1045
- should_be_ruby_version_incorrect(:exitstatus => false)
1046
- end
1047
-
1048
- it "fails when engine doesn't match" do
1049
- install_gemfile <<-G
1050
- source "file://#{gem_repo1}"
1051
- gem "yard"
1052
- gem "rack"
1053
-
1054
- #{engine_incorrect}
1055
- G
1056
-
1057
- File.read(bundled_app("Gemfile.lock"))
1058
-
1059
- FileUtils.rm(bundled_app("Gemfile.lock"))
1060
-
1061
- ruby <<-R
1062
- require 'rubygems'
1063
- require 'bundler'
1064
-
1065
- begin
1066
- Bundler.setup
1067
- rescue Bundler::RubyVersionMismatch => e
1068
- puts e.message
1069
- end
1070
- R
1071
-
1072
- expect(bundled_app("Gemfile.lock")).not_to exist
1073
- should_be_engine_incorrect(:exitstatus => false)
1074
- end
1075
-
1076
- it "fails when engine version doesn't match" do
1077
- simulate_ruby_engine "jruby" do
1078
- install_gemfile <<-G
1079
- source "file://#{gem_repo1}"
1080
- gem "yard"
1081
- gem "rack"
1082
-
1083
- #{engine_version_incorrect}
1084
- G
1085
-
1086
- File.read(bundled_app("Gemfile.lock"))
1087
-
1088
- FileUtils.rm(bundled_app("Gemfile.lock"))
1089
-
1090
- ruby <<-R
1091
- require 'rubygems'
1092
- require 'bundler'
1093
-
1094
- begin
1095
- Bundler.setup
1096
- rescue Bundler::RubyVersionMismatch => e
1097
- puts e.message
1098
- end
1099
- R
1100
-
1101
- expect(bundled_app("Gemfile.lock")).not_to exist
1102
- should_be_engine_version_incorrect(:exitstatus => false)
1103
- end
1104
- end
1105
-
1106
- it "fails when patchlevel doesn't match" do
1107
- install_gemfile <<-G
1108
- source "file://#{gem_repo1}"
1109
- gem "yard"
1110
- gem "rack"
1111
-
1112
- #{patchlevel_incorrect}
1113
- G
1114
-
1115
- puts File.read(bundled_app("Gemfile"))
1116
- File.read(bundled_app("Gemfile.lock"))
1117
-
1118
- FileUtils.rm(bundled_app("Gemfile.lock"))
1119
-
1120
- ruby <<-R
1121
- require 'rubygems'
1122
- require 'bundler'
1123
-
1124
- begin
1125
- Bundler.setup
1126
- rescue Bundler::RubyVersionMismatch => e
1127
- puts e.message
1128
- end
1129
- R
1130
-
1131
- expect(bundled_app("Gemfile.lock")).not_to exist
1132
- should_be_patchlevel_incorrect(:exitstatus => false)
1133
- end
1134
- end
1135
-
1136
- context "bundle outdated" do
1137
- before do
1138
- build_repo2 do
1139
- build_git "foo", :path => lib_path("foo")
1140
- end
1141
-
1142
- install_gemfile <<-G
1143
- source "file://#{gem_repo2}"
1144
- gem "activesupport", "2.3.5"
1145
- gem "foo", :git => "#{lib_path('foo')}"
1146
- G
1147
- end
1148
-
1149
- it "returns list of outdated gems when the ruby version matches" do
1150
- update_repo2 do
1151
- build_gem "activesupport", "3.0"
1152
- update_git "foo", :path => lib_path("foo")
1153
- end
1154
-
1155
- gemfile <<-G
1156
- source "file://#{gem_repo2}"
1157
- gem "activesupport", "2.3.5"
1158
- gem "foo", :git => "#{lib_path('foo')}"
1159
-
1160
- #{ruby_version_correct}
1161
- G
1162
-
1163
- bundle "outdated"
1164
- expect(out).to include("activesupport (3.0 > 2.3.5)")
1165
- expect(out).to include("foo (1.0")
1166
- end
1167
-
1168
- it "returns list of outdated gems when the ruby version matches for any engine" do
1169
- simulate_ruby_engine "jruby" do
1170
- update_repo2 do
1171
- build_gem "activesupport", "3.0"
1172
- update_git "foo", :path => lib_path("foo")
1173
- end
1174
-
1175
- gemfile <<-G
1176
- source "file://#{gem_repo2}"
1177
- gem "activesupport", "2.3.5"
1178
- gem "foo", :git => "#{lib_path('foo')}"
1179
-
1180
- #{ruby_version_correct_engineless}
1181
- G
1182
-
1183
- bundle "outdated"
1184
- expect(out).to include("activesupport (3.0 > 2.3.5)")
1185
- expect(out).to include("foo (1.0")
1186
- end
1187
- end
1188
-
1189
- it "fails when the ruby version doesn't match" do
1190
- update_repo2 do
1191
- build_gem "activesupport", "3.0"
1192
- update_git "foo", :path => lib_path("foo")
1193
- end
1194
-
1195
- gemfile <<-G
1196
- source "file://#{gem_repo2}"
1197
- gem "activesupport", "2.3.5"
1198
- gem "foo", :git => "#{lib_path('foo')}"
1199
-
1200
- #{ruby_version_incorrect}
1201
- G
1202
-
1203
- bundle "outdated", :exitstatus => true
1204
- should_be_ruby_version_incorrect
1205
- end
1206
-
1207
- it "fails when the engine doesn't match" do
1208
- update_repo2 do
1209
- build_gem "activesupport", "3.0"
1210
- update_git "foo", :path => lib_path("foo")
1211
- end
1212
-
1213
- gemfile <<-G
1214
- source "file://#{gem_repo2}"
1215
- gem "activesupport", "2.3.5"
1216
- gem "foo", :git => "#{lib_path('foo')}"
1217
-
1218
- #{engine_incorrect}
1219
- G
1220
-
1221
- bundle "outdated", :exitstatus => true
1222
- should_be_engine_incorrect
1223
- end
1224
-
1225
- it "fails when the engine version doesn't match" do
1226
- simulate_ruby_engine "jruby" do
1227
- update_repo2 do
1228
- build_gem "activesupport", "3.0"
1229
- update_git "foo", :path => lib_path("foo")
1230
- end
1231
-
1232
- gemfile <<-G
1233
- source "file://#{gem_repo2}"
1234
- gem "activesupport", "2.3.5"
1235
- gem "foo", :git => "#{lib_path('foo')}"
1236
-
1237
- #{engine_version_incorrect}
1238
- G
1239
-
1240
- bundle "outdated", :exitstatus => true
1241
- should_be_engine_version_incorrect
1242
- end
1243
- end
1244
-
1245
- it "fails when the patchlevel doesn't match" do
1246
- simulate_ruby_engine "jruby" do
1247
- update_repo2 do
1248
- build_gem "activesupport", "3.0"
1249
- update_git "foo", :path => lib_path("foo")
1250
- end
1251
-
1252
- gemfile <<-G
1253
- source "file://#{gem_repo2}"
1254
- gem "activesupport", "2.3.5"
1255
- gem "foo", :git => "#{lib_path('foo')}"
1256
-
1257
- #{patchlevel_incorrect}
1258
- G
1259
-
1260
- bundle "outdated", :exitstatus => true
1261
- should_be_patchlevel_incorrect
1262
- end
1263
- end
1264
-
1265
- it "fails when the patchlevel is a fixnum" do
1266
- simulate_ruby_engine "jruby" do
1267
- update_repo2 do
1268
- build_gem "activesupport", "3.0"
1269
- update_git "foo", :path => lib_path("foo")
1270
- end
1271
-
1272
- gemfile <<-G
1273
- source "file://#{gem_repo2}"
1274
- gem "activesupport", "2.3.5"
1275
- gem "foo", :git => "#{lib_path('foo')}"
1276
-
1277
- #{patchlevel_fixnum}
1278
- G
1279
-
1280
- bundle "outdated", :exitstatus => true
1281
- should_be_patchlevel_fixnum
1282
- end
1283
- end
1284
- end
1285
- end