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,24 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "bundle install" do
4
-
5
- describe "when system_bindir is set" do
6
- # On OS X, Gem.bindir defaults to /usr/bin, so system_bindir is useful if
7
- # you want to avoid sudo installs for system gems with OS X's default ruby
8
- it "overrides Gem.bindir" do
9
- expect(Pathname.new("/usr/bin")).not_to be_writable unless Process::euid == 0
10
- gemfile <<-G
11
- require 'rubygems'
12
- def Gem.bindir; "/usr/bin"; end
13
- source "file://#{gem_repo1}"
14
- gem "rack"
15
- G
16
-
17
- config "BUNDLE_SYSTEM_BINDIR" => system_gem_path('altbin').to_s
18
- bundle :install
19
- should_be_installed "rack 1.0.0"
20
- expect(system_gem_path("altbin/rackup")).to exist
21
- end
22
- end
23
-
24
- end
@@ -1,146 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "bundle install" do
4
-
5
- describe "with bundler dependencies" do
6
- before(:each) do
7
- build_repo2 do
8
- build_gem "rails", "3.0" do |s|
9
- s.add_dependency "bundler", ">= 0.9.0.pre"
10
- end
11
- build_gem "bundler", "0.9.1"
12
- build_gem "bundler", Bundler::VERSION
13
- end
14
- end
15
-
16
- it "are forced to the current bundler version" do
17
- install_gemfile <<-G
18
- source "file://#{gem_repo2}"
19
- gem "rails", "3.0"
20
- G
21
-
22
- should_be_installed "bundler #{Bundler::VERSION}"
23
- end
24
-
25
- it "are not added if not already present" do
26
- install_gemfile <<-G
27
- source "file://#{gem_repo1}"
28
- gem "rack"
29
- G
30
- should_not_be_installed "bundler #{Bundler::VERSION}"
31
- end
32
-
33
- it "causes a conflict if explicitly requesting a different version" do
34
- install_gemfile <<-G
35
- source "file://#{gem_repo2}"
36
- gem "rails", "3.0"
37
- gem "bundler", "0.9.2"
38
- G
39
-
40
- nice_error = <<-E.strip.gsub(/^ {8}/, '')
41
- Fetching source index from file:#{gem_repo2}/
42
- Resolving dependencies...
43
- Bundler could not find compatible versions for gem "bundler":
44
- In Gemfile:
45
- bundler (= 0.9.2) ruby
46
-
47
- Current Bundler version:
48
- bundler (#{Bundler::VERSION})
49
- E
50
- expect(out).to include(nice_error)
51
- end
52
-
53
- it "works for gems with multiple versions in its dependencies" do
54
- install_gemfile <<-G
55
- source "file://#{gem_repo2}"
56
-
57
- gem "multiple_versioned_deps"
58
- G
59
-
60
-
61
- install_gemfile <<-G
62
- source "file://#{gem_repo2}"
63
-
64
- gem "multiple_versioned_deps"
65
- gem "rack"
66
- G
67
-
68
- should_be_installed "multiple_versioned_deps 1.0.0"
69
- end
70
-
71
- it "includes bundler in the bundle when it's a child dependency" do
72
- install_gemfile <<-G
73
- source "file://#{gem_repo2}"
74
- gem "rails", "3.0"
75
- G
76
-
77
- run "begin; gem 'bundler'; puts 'WIN'; rescue Gem::LoadError; puts 'FAIL'; end"
78
- expect(out).to eq("WIN")
79
- end
80
-
81
- it "allows gem 'bundler' when Bundler is not in the Gemfile or its dependencies" do
82
- install_gemfile <<-G
83
- source "file://#{gem_repo2}"
84
- gem "rack"
85
- G
86
-
87
- run "begin; gem 'bundler'; puts 'WIN'; rescue Gem::LoadError => e; puts e.backtrace; end"
88
- expect(out).to eq("WIN")
89
- end
90
-
91
- it "causes a conflict if child dependencies conflict" do
92
- install_gemfile <<-G
93
- source "file://#{gem_repo2}"
94
- gem "activemerchant"
95
- gem "rails_fail"
96
- G
97
-
98
- nice_error = <<-E.strip.gsub(/^ {8}/, '')
99
- Fetching source index from file:#{gem_repo2}/
100
- Resolving dependencies...
101
- Bundler could not find compatible versions for gem "activesupport":
102
- In Gemfile:
103
- activemerchant (>= 0) ruby depends on
104
- activesupport (>= 2.0.0) ruby
105
-
106
- rails_fail (>= 0) ruby depends on
107
- activesupport (1.2.3)
108
- E
109
- expect(out).to eq(nice_error)
110
- end
111
-
112
- it "causes a conflict if a child dependency conflicts with the Gemfile" do
113
- install_gemfile <<-G
114
- source "file://#{gem_repo2}"
115
- gem "rails_fail"
116
- gem "activesupport", "2.3.5"
117
- G
118
-
119
- nice_error = <<-E.strip.gsub(/^ {8}/, '')
120
- Fetching source index from file:#{gem_repo2}/
121
- Resolving dependencies...
122
- Bundler could not find compatible versions for gem "activesupport":
123
- In Gemfile:
124
- rails_fail (>= 0) ruby depends on
125
- activesupport (= 1.2.3) ruby
126
-
127
- activesupport (2.3.5)
128
- E
129
- expect(out).to eq(nice_error)
130
- end
131
-
132
- it "can install dependencies with newer bundler version" do
133
- install_gemfile <<-G
134
- source "file://#{gem_repo2}"
135
- gem "rails", "3.0"
136
- G
137
-
138
- simulate_bundler_version "10.0.0"
139
- #simulate_new_machine
140
-
141
- bundle "check"
142
- expect(out).to eq("The Gemfile's dependencies are satisfied")
143
- end
144
- end
145
-
146
- end
@@ -1,250 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "install with --deployment or --frozen" do
4
- before do
5
- gemfile <<-G
6
- source "file://#{gem_repo1}"
7
- gem "rack"
8
- G
9
- end
10
-
11
- it "fails without a lockfile and says that --deployment requires a lock" do
12
- bundle "install --deployment"
13
- expect(out).to include("The --deployment flag requires a Gemfile.lock")
14
- end
15
-
16
- it "fails without a lockfile and says that --frozen requires a lock" do
17
- bundle "install --frozen"
18
- expect(out).to include("The --frozen flag requires a Gemfile.lock")
19
- end
20
-
21
- it "works after you try to deploy without a lock" do
22
- bundle "install --deployment"
23
- bundle :install, :exitstatus => true
24
- expect(exitstatus).to eq(0)
25
- should_be_installed "rack 1.0"
26
- end
27
-
28
- it "still works if you are not in the app directory and specify --gemfile" do
29
- bundle "install"
30
- Dir.chdir tmp
31
- simulate_new_machine
32
- bundle "install --gemfile #{tmp}/bundled_app/Gemfile --deployment"
33
- Dir.chdir bundled_app
34
- should_be_installed "rack 1.0"
35
- end
36
-
37
- it "works if you exclude a group with a git gem" do
38
- build_git "foo"
39
- gemfile <<-G
40
- group :test do
41
- gem "foo", :git => "#{lib_path('foo-1.0')}"
42
- end
43
- G
44
- bundle :install
45
- bundle "install --deployment --without test", :exitstatus => true
46
- expect(exitstatus).to eq(0)
47
- end
48
-
49
- it "works when you bundle exec bundle" do
50
- bundle :install
51
- bundle "install --deployment"
52
- bundle "exec bundle check", :exitstatus => true
53
- expect(exitstatus).to eq(0)
54
- end
55
-
56
- it "works when using path gems from the same path and the version is specified" do
57
- build_lib "foo", :path => lib_path("nested/foo")
58
- build_lib "bar", :path => lib_path("nested/bar")
59
- gemfile <<-G
60
- gem "foo", "1.0", :path => "#{lib_path("nested")}"
61
- gem "bar", :path => "#{lib_path("nested")}"
62
- G
63
-
64
- bundle :install
65
- bundle "install --deployment", :exitstatus => true
66
-
67
- expect(exitstatus).to eq(0)
68
- end
69
-
70
- it "works when there are credentials in the source URL" do
71
- install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
72
- source "http://user:pass@localgemserver.test/"
73
-
74
- gem "rack-obama", ">= 1.0"
75
- G
76
-
77
- bundle "install --deployment", :exitstatus => true, :artifice => "endpoint_strict_basic_authentication"
78
-
79
- expect(exitstatus).to eq(0)
80
- end
81
-
82
- it "works with sources given by a block" do
83
- install_gemfile <<-G
84
- source "file://#{gem_repo1}" do
85
- gem "rack"
86
- end
87
- G
88
-
89
- bundle "install --deployment", :exitstatus => true
90
-
91
- expect(exitstatus).to eq(0)
92
- should_be_installed "rack 1.0"
93
- end
94
-
95
- describe "with an existing lockfile" do
96
- before do
97
- bundle "install"
98
- end
99
-
100
- it "works with the --deployment flag if you didn't change anything" do
101
- bundle "install --deployment", :exitstatus => true
102
- expect(exitstatus).to eq(0)
103
- end
104
-
105
- it "works with the --frozen flag if you didn't change anything" do
106
- bundle "install --frozen", :exitstatus => true
107
- expect(exitstatus).to eq(0)
108
- end
109
-
110
- it "explodes with the --deployment flag if you make a change and don't check in the lockfile" do
111
- gemfile <<-G
112
- source "file://#{gem_repo1}"
113
- gem "rack"
114
- gem "rack-obama"
115
- G
116
-
117
- bundle "install --deployment"
118
- expect(out).to include("deployment mode")
119
- expect(out).to include("You have added to the Gemfile")
120
- expect(out).to include("* rack-obama")
121
- expect(out).not_to include("You have deleted from the Gemfile")
122
- expect(out).not_to include("You have changed in the Gemfile")
123
- end
124
-
125
- it "can have --frozen set via an environment variable" do
126
- gemfile <<-G
127
- source "file://#{gem_repo1}"
128
- gem "rack"
129
- gem "rack-obama"
130
- G
131
-
132
- ENV['BUNDLE_FROZEN'] = '1'
133
- bundle "install"
134
- expect(out).to include("deployment mode")
135
- expect(out).to include("You have added to the Gemfile")
136
- expect(out).to include("* rack-obama")
137
- expect(out).not_to include("You have deleted from the Gemfile")
138
- expect(out).not_to include("You have changed in the Gemfile")
139
- end
140
-
141
- it "can have --frozen set to false via an environment variable" do
142
- gemfile <<-G
143
- source "file://#{gem_repo1}"
144
- gem "rack"
145
- gem "rack-obama"
146
- G
147
-
148
- ENV['BUNDLE_FROZEN'] = "false"
149
- bundle "install"
150
- expect(out).not_to include("deployment mode")
151
- expect(out).not_to include("You have added to the Gemfile")
152
- expect(out).not_to include("* rack-obama")
153
- end
154
-
155
- it "explodes with the --frozen flag if you make a change and don't check in the lockfile" do
156
- gemfile <<-G
157
- source "file://#{gem_repo1}"
158
- gem "rack"
159
- gem "rack-obama"
160
- G
161
-
162
- bundle "install --frozen"
163
- expect(out).to include("deployment mode")
164
- expect(out).to include("You have added to the Gemfile")
165
- expect(out).to include("* rack-obama")
166
- expect(out).not_to include("You have deleted from the Gemfile")
167
- expect(out).not_to include("You have changed in the Gemfile")
168
- end
169
-
170
- it "explodes if you remove a gem and don't check in the lockfile" do
171
- gemfile <<-G
172
- source "file://#{gem_repo1}"
173
- gem "activesupport"
174
- G
175
-
176
- bundle "install --deployment"
177
- expect(out).to include("deployment mode")
178
- expect(out).to include("You have added to the Gemfile:\n* activesupport\n\n")
179
- expect(out).to include("You have deleted from the Gemfile:\n* rack")
180
- expect(out).not_to include("You have changed in the Gemfile")
181
- end
182
-
183
- it "explodes if you add a source" do
184
- gemfile <<-G
185
- source "file://#{gem_repo1}"
186
- gem "rack", :git => "git://hubz.com"
187
- G
188
-
189
- bundle "install --deployment"
190
- expect(out).to include("deployment mode")
191
- expect(out).to include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
192
- expect(out).not_to include("You have changed in the Gemfile")
193
- end
194
-
195
- it "explodes if you unpin a source" do
196
- build_git "rack"
197
-
198
- install_gemfile <<-G
199
- source "file://#{gem_repo1}"
200
- gem "rack", :git => "#{lib_path("rack-1.0")}"
201
- G
202
-
203
- gemfile <<-G
204
- source "file://#{gem_repo1}"
205
- gem "rack"
206
- G
207
-
208
- bundle "install --deployment"
209
- expect(out).to include("deployment mode")
210
- expect(out).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master)")
211
- expect(out).not_to include("You have added to the Gemfile")
212
- expect(out).not_to include("You have changed in the Gemfile")
213
- end
214
-
215
- it "explodes if you unpin a source, leaving it pinned somewhere else" do
216
- build_lib "foo", :path => lib_path("rack/foo")
217
- build_git "rack", :path => lib_path("rack")
218
-
219
- install_gemfile <<-G
220
- source "file://#{gem_repo1}"
221
- gem "rack", :git => "#{lib_path("rack")}"
222
- gem "foo", :git => "#{lib_path("rack")}"
223
- G
224
-
225
- gemfile <<-G
226
- source "file://#{gem_repo1}"
227
- gem "rack"
228
- gem "foo", :git => "#{lib_path("rack")}"
229
- G
230
-
231
- bundle "install --deployment"
232
- expect(out).to include("deployment mode")
233
- expect(out).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`")
234
- expect(out).not_to include("You have added to the Gemfile")
235
- expect(out).not_to include("You have deleted from the Gemfile")
236
- end
237
-
238
- it "remembers that the bundle is frozen at runtime" do
239
- bundle "install --deployment"
240
-
241
- gemfile <<-G
242
- source "file://#{gem_repo1}"
243
- gem "rack", "1.0.0"
244
- gem "rack-obama"
245
- G
246
-
247
- should_be_installed "rack 1.0.0"
248
- end
249
- end
250
- end
@@ -1,170 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle install from an existing gemspec" do
4
-
5
- before(:each) do
6
- build_gem "bar", :to_system => true
7
- build_gem "bar-dev", :to_system => true
8
- end
9
-
10
- it "should install runtime and development dependencies" do
11
- build_lib("foo", :path => tmp.join("foo")) do |s|
12
- s.write("Gemfile", "source :rubygems\ngemspec")
13
- s.add_dependency "bar", "=1.0.0"
14
- s.add_development_dependency "bar-dev", '=1.0.0'
15
- end
16
- install_gemfile <<-G
17
- source "file://#{gem_repo2}"
18
- gemspec :path => '#{tmp.join("foo")}'
19
- G
20
-
21
- should_be_installed "bar 1.0.0"
22
- should_be_installed "bar-dev 1.0.0", :groups => :development
23
- end
24
-
25
- it "that is hidden should install runtime and development dependencies" do
26
- build_lib("foo", :path => tmp.join("foo")) do |s|
27
- s.write("Gemfile", "source :rubygems\ngemspec")
28
- s.add_dependency "bar", "=1.0.0"
29
- s.add_development_dependency "bar-dev", '=1.0.0'
30
- end
31
- FileUtils.mv tmp.join('foo', 'foo.gemspec'), tmp.join('foo', '.gemspec')
32
-
33
- install_gemfile <<-G
34
- source "file://#{gem_repo2}"
35
- gemspec :path => '#{tmp.join("foo")}'
36
- G
37
-
38
- should_be_installed "bar 1.0.0"
39
- should_be_installed "bar-dev 1.0.0", :groups => :development
40
- end
41
-
42
- it "should handle a list of requirements" do
43
- build_gem "baz", "1.0", :to_system => true
44
- build_gem "baz", "1.1", :to_system => true
45
-
46
- build_lib("foo", :path => tmp.join("foo")) do |s|
47
- s.write("Gemfile", "source :rubygems\ngemspec")
48
- s.add_dependency "baz", ">= 1.0", "< 1.1"
49
- end
50
- install_gemfile <<-G
51
- source "file://#{gem_repo2}"
52
- gemspec :path => '#{tmp.join("foo")}'
53
- G
54
-
55
- should_be_installed "baz 1.0"
56
- end
57
-
58
- it "should raise if there are no gemspecs available" do
59
- build_lib("foo", :path => tmp.join("foo"), :gemspec => false)
60
-
61
- error = install_gemfile(<<-G, :expect_err => true)
62
- source "file://#{gem_repo2}"
63
- gemspec :path => '#{tmp.join("foo")}'
64
- G
65
- expect(error).to match(/There are no gemspecs at #{tmp.join('foo')}/)
66
- end
67
-
68
- it "should raise if there are too many gemspecs available" do
69
- build_lib("foo", :path => tmp.join("foo")) do |s|
70
- s.write("foo2.gemspec", "")
71
- end
72
-
73
- error = install_gemfile(<<-G, :expect_err => true)
74
- source "file://#{gem_repo2}"
75
- gemspec :path => '#{tmp.join("foo")}'
76
- G
77
- expect(error).to match(/There are multiple gemspecs at #{tmp.join('foo')}/)
78
- end
79
-
80
- it "should pick a specific gemspec" do
81
- build_lib("foo", :path => tmp.join("foo")) do |s|
82
- s.write("foo2.gemspec", "")
83
- s.add_dependency "bar", "=1.0.0"
84
- s.add_development_dependency "bar-dev", '=1.0.0'
85
- end
86
-
87
- install_gemfile(<<-G, :expect_err => true)
88
- source "file://#{gem_repo2}"
89
- gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
90
- G
91
-
92
- should_be_installed "bar 1.0.0"
93
- should_be_installed "bar-dev 1.0.0", :groups => :development
94
- end
95
-
96
- it "should use a specific group for development dependencies" do
97
- build_lib("foo", :path => tmp.join("foo")) do |s|
98
- s.write("foo2.gemspec", "")
99
- s.add_dependency "bar", "=1.0.0"
100
- s.add_development_dependency "bar-dev", '=1.0.0'
101
- end
102
-
103
- install_gemfile(<<-G, :expect_err => true)
104
- source "file://#{gem_repo2}"
105
- gemspec :path => '#{tmp.join("foo")}', :name => 'foo', :development_group => :dev
106
- G
107
-
108
- should_be_installed "bar 1.0.0"
109
- should_not_be_installed "bar-dev 1.0.0", :groups => :development
110
- should_be_installed "bar-dev 1.0.0", :groups => :dev
111
- end
112
-
113
- it "should match a lockfile even if the gemspec defines development dependencies" do
114
- build_lib("foo", :path => tmp.join("foo")) do |s|
115
- s.write("Gemfile", "source 'file://#{gem_repo1}'\ngemspec")
116
- s.add_dependency "actionpack", "=2.3.2"
117
- s.add_development_dependency "rake", '=10.0.2'
118
- end
119
-
120
- Dir.chdir(tmp.join("foo")) do
121
- bundle "install"
122
- # This should really be able to rely on $stderr, but, it's not written
123
- # right, so we can't. In fact, this is a bug negation test, and so it'll
124
- # ghost pass in future, and will only catch a regression if the message
125
- # doesn't change. Exit codes should be used correctly (they can be more
126
- # than just 0 and 1).
127
- output = bundle("install --deployment")
128
- expect(output).not_to match(/You have added to the Gemfile/)
129
- expect(output).not_to match(/You have deleted from the Gemfile/)
130
- expect(output).not_to match(/install in deployment mode after changing/)
131
- end
132
- end
133
-
134
- it "should evaluate the gemspec in its directory" do
135
- build_lib("foo", :path => tmp.join("foo"))
136
- File.open(tmp.join("foo/foo.gemspec"), "w") do |s|
137
- s.write "raise 'ahh' unless Dir.pwd == '#{tmp.join("foo")}'"
138
- end
139
-
140
- install_gemfile <<-G, :expect_err => true
141
- gemspec :path => '#{tmp.join("foo")}'
142
- G
143
- expect(@err).not_to match(/ahh/)
144
- end
145
-
146
- context "when child gemspecs conflict with a released gemspec" do
147
- before do
148
- # build the "parent" gem that depends on another gem in the same repo
149
- build_lib "source_conflict", :path => bundled_app do |s|
150
- s.add_dependency "rack_middleware"
151
- end
152
-
153
- # build the "child" gem that is the same version as a released gem, but
154
- # has completely different and conflicting dependency requirements
155
- build_lib "rack_middleware", "1.0", :path => bundled_app("rack_middleware") do |s|
156
- s.add_dependency "rack", "1.0" # anything other than 0.9.1
157
- end
158
- end
159
-
160
- it "should install the child gemspec's deps" do
161
- install_gemfile <<-G
162
- source "file://#{gem_repo1}"
163
- gemspec
164
- G
165
-
166
- should_be_installed "rack 1.0"
167
- end
168
- end
169
-
170
- end