mpapis-bundler 1.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/.gitignore +22 -0
  2. data/.travis.yml +32 -0
  3. data/CHANGELOG.md +805 -0
  4. data/ISSUES.md +62 -0
  5. data/LICENSE +23 -0
  6. data/README.md +29 -0
  7. data/Rakefile +212 -0
  8. data/UPGRADING.md +103 -0
  9. data/bin/bundle +22 -0
  10. data/bundler.gemspec +32 -0
  11. data/lib/bundler/capistrano.rb +11 -0
  12. data/lib/bundler/cli.rb +522 -0
  13. data/lib/bundler/definition.rb +438 -0
  14. data/lib/bundler/dependency.rb +134 -0
  15. data/lib/bundler/deployment.rb +58 -0
  16. data/lib/bundler/dsl.rb +257 -0
  17. data/lib/bundler/environment.rb +47 -0
  18. data/lib/bundler/gem_helper.rb +151 -0
  19. data/lib/bundler/gem_installer.rb +9 -0
  20. data/lib/bundler/gem_tasks.rb +2 -0
  21. data/lib/bundler/graph.rb +130 -0
  22. data/lib/bundler/index.rb +138 -0
  23. data/lib/bundler/installer.rb +97 -0
  24. data/lib/bundler/lazy_specification.rb +74 -0
  25. data/lib/bundler/lockfile_parser.rb +108 -0
  26. data/lib/bundler/remote_specification.rb +59 -0
  27. data/lib/bundler/resolver.rb +464 -0
  28. data/lib/bundler/rubygems_ext.rb +237 -0
  29. data/lib/bundler/rubygems_integration.rb +349 -0
  30. data/lib/bundler/runtime.rb +152 -0
  31. data/lib/bundler/settings.rb +115 -0
  32. data/lib/bundler/setup.rb +23 -0
  33. data/lib/bundler/shared_helpers.rb +71 -0
  34. data/lib/bundler/source.rb +708 -0
  35. data/lib/bundler/spec_set.rb +135 -0
  36. data/lib/bundler/templates/Executable +16 -0
  37. data/lib/bundler/templates/Gemfile +4 -0
  38. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  39. data/lib/bundler/templates/newgem/Rakefile.tt +1 -0
  40. data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
  41. data/lib/bundler/templates/newgem/gitignore.tt +4 -0
  42. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  43. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -0
  44. data/lib/bundler/templates/newgem/newgem.gemspec.tt +24 -0
  45. data/lib/bundler/ui.rb +73 -0
  46. data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
  47. data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
  48. data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
  49. data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
  50. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +270 -0
  51. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +109 -0
  52. data/lib/bundler/vendor/thor/actions.rb +314 -0
  53. data/lib/bundler/vendor/thor/base.rb +576 -0
  54. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
  55. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  56. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
  57. data/lib/bundler/vendor/thor/error.rb +30 -0
  58. data/lib/bundler/vendor/thor/group.rb +273 -0
  59. data/lib/bundler/vendor/thor/invocation.rb +168 -0
  60. data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
  61. data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
  62. data/lib/bundler/vendor/thor/parser/option.rb +120 -0
  63. data/lib/bundler/vendor/thor/parser/options.rb +175 -0
  64. data/lib/bundler/vendor/thor/parser.rb +4 -0
  65. data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
  66. data/lib/bundler/vendor/thor/runner.rb +309 -0
  67. data/lib/bundler/vendor/thor/shell/basic.rb +302 -0
  68. data/lib/bundler/vendor/thor/shell/color.rb +108 -0
  69. data/lib/bundler/vendor/thor/shell/html.rb +121 -0
  70. data/lib/bundler/vendor/thor/shell.rb +88 -0
  71. data/lib/bundler/vendor/thor/task.rb +113 -0
  72. data/lib/bundler/vendor/thor/util.rb +229 -0
  73. data/lib/bundler/vendor/thor/version.rb +3 -0
  74. data/lib/bundler/vendor/thor.rb +358 -0
  75. data/lib/bundler/vendored_thor.rb +7 -0
  76. data/lib/bundler/version.rb +6 -0
  77. data/lib/bundler/vlad.rb +11 -0
  78. data/lib/bundler.rb +286 -0
  79. data/man/bundle-config.ronn +90 -0
  80. data/man/bundle-exec.ronn +111 -0
  81. data/man/bundle-install.ronn +317 -0
  82. data/man/bundle-package.ronn +59 -0
  83. data/man/bundle-update.ronn +176 -0
  84. data/man/bundle.ronn +80 -0
  85. data/man/gemfile.5.ronn +284 -0
  86. data/man/index.txt +6 -0
  87. data/spec/bundler/gem_helper_spec.rb +143 -0
  88. data/spec/cache/gems_spec.rb +230 -0
  89. data/spec/cache/git_spec.rb +12 -0
  90. data/spec/cache/path_spec.rb +27 -0
  91. data/spec/cache/platform_spec.rb +57 -0
  92. data/spec/install/deploy_spec.rb +197 -0
  93. data/spec/install/deprecated_spec.rb +37 -0
  94. data/spec/install/gems/c_ext_spec.rb +48 -0
  95. data/spec/install/gems/env_spec.rb +107 -0
  96. data/spec/install/gems/flex_spec.rb +313 -0
  97. data/spec/install/gems/groups_spec.rb +259 -0
  98. data/spec/install/gems/packed_spec.rb +84 -0
  99. data/spec/install/gems/platform_spec.rb +192 -0
  100. data/spec/install/gems/resolving_spec.rb +72 -0
  101. data/spec/install/gems/simple_case_spec.rb +770 -0
  102. data/spec/install/gems/sudo_spec.rb +74 -0
  103. data/spec/install/gems/win32_spec.rb +26 -0
  104. data/spec/install/gemspec_spec.rb +125 -0
  105. data/spec/install/git_spec.rb +570 -0
  106. data/spec/install/invalid_spec.rb +35 -0
  107. data/spec/install/path_spec.rb +405 -0
  108. data/spec/install/upgrade_spec.rb +26 -0
  109. data/spec/lock/git_spec.rb +35 -0
  110. data/spec/lock/lockfile_spec.rb +739 -0
  111. data/spec/other/check_spec.rb +221 -0
  112. data/spec/other/config_spec.rb +40 -0
  113. data/spec/other/console_spec.rb +54 -0
  114. data/spec/other/exec_spec.rb +248 -0
  115. data/spec/other/ext_spec.rb +37 -0
  116. data/spec/other/help_spec.rb +39 -0
  117. data/spec/other/init_spec.rb +40 -0
  118. data/spec/other/newgem_spec.rb +46 -0
  119. data/spec/other/open_spec.rb +35 -0
  120. data/spec/other/show_spec.rb +82 -0
  121. data/spec/quality_spec.rb +62 -0
  122. data/spec/resolver/basic_spec.rb +20 -0
  123. data/spec/resolver/platform_spec.rb +82 -0
  124. data/spec/runtime/executable_spec.rb +110 -0
  125. data/spec/runtime/load_spec.rb +107 -0
  126. data/spec/runtime/platform_spec.rb +90 -0
  127. data/spec/runtime/require_spec.rb +231 -0
  128. data/spec/runtime/setup_spec.rb +730 -0
  129. data/spec/runtime/with_clean_env_spec.rb +15 -0
  130. data/spec/spec_helper.rb +92 -0
  131. data/spec/support/builders.rb +597 -0
  132. data/spec/support/helpers.rb +239 -0
  133. data/spec/support/indexes.rb +112 -0
  134. data/spec/support/matchers.rb +77 -0
  135. data/spec/support/path.rb +71 -0
  136. data/spec/support/platforms.rb +53 -0
  137. data/spec/support/ruby_ext.rb +20 -0
  138. data/spec/support/rubygems_ext.rb +37 -0
  139. data/spec/support/rubygems_hax/platform.rb +11 -0
  140. data/spec/support/sudo.rb +21 -0
  141. data/spec/update/gems_spec.rb +122 -0
  142. data/spec/update/git_spec.rb +196 -0
  143. data/spec/update/source_spec.rb +51 -0
  144. metadata +314 -0
@@ -0,0 +1,230 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle cache" do
4
+
5
+ describe "when there are only gemsources" do
6
+ before :each do
7
+ gemfile <<-G
8
+ gem 'rack'
9
+ G
10
+
11
+ system_gems "rack-1.0.0"
12
+ bundle :cache
13
+ end
14
+
15
+ it "copies the .gem file to vendor/cache" do
16
+ bundled_app("vendor/cache/rack-1.0.0.gem").should exist
17
+ end
18
+
19
+ it "uses the cache as a source when installing gems" do
20
+ build_gem "omg", :path => bundled_app('vendor/cache')
21
+
22
+ install_gemfile <<-G
23
+ source "file://#{gem_repo1}"
24
+ gem "omg"
25
+ G
26
+
27
+ should_be_installed "omg 1.0.0"
28
+ end
29
+
30
+ it "uses the cache as a source when installing gems with --local" do
31
+ system_gems []
32
+ bundle "install --local"
33
+
34
+ should_be_installed("rack 1.0.0")
35
+ end
36
+
37
+ it "does not reinstall gems from the cache if they exist on the system" do
38
+ build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
39
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
40
+ end
41
+
42
+ install_gemfile <<-G
43
+ gem "rack"
44
+ G
45
+
46
+ should_be_installed("rack 1.0.0")
47
+ end
48
+
49
+ it "does not reinstall gems from the cache if they exist in the bundle" do
50
+ system_gems "rack-1.0.0"
51
+
52
+ gemfile <<-G
53
+ gem "rack"
54
+ G
55
+
56
+ build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
57
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
58
+ end
59
+
60
+ bundle "install --local"
61
+ should_be_installed("rack 1.0.0")
62
+ end
63
+
64
+ it "creates a lockfile" do
65
+ cache_gems "rack-1.0.0"
66
+
67
+ gemfile <<-G
68
+ gem "rack"
69
+ G
70
+
71
+ bundle "cache"
72
+
73
+ bundled_app("Gemfile.lock").should exist
74
+ end
75
+ end
76
+
77
+ describe "when there are also git sources" do
78
+ before do
79
+ build_git "foo"
80
+ system_gems "rack-1.0.0"
81
+
82
+ install_gemfile <<-G
83
+ source "file://#{gem_repo1}"
84
+ git "#{lib_path("foo-1.0")}" do
85
+ gem 'foo'
86
+ end
87
+ gem 'rack'
88
+ G
89
+ end
90
+
91
+ it "still works" do
92
+ bundle :cache
93
+
94
+ system_gems []
95
+ bundle "install --local"
96
+
97
+ should_be_installed("rack 1.0.0", "foo 1.0")
98
+ end
99
+
100
+ it "should not explode if the lockfile is not present" do
101
+ FileUtils.rm(bundled_app("Gemfile.lock"))
102
+
103
+ bundle :cache
104
+
105
+ bundled_app("Gemfile.lock").should exist
106
+ end
107
+ end
108
+
109
+ describe "when previously cached" do
110
+ before :each do
111
+ build_repo2
112
+ install_gemfile <<-G
113
+ source "file://#{gem_repo2}"
114
+ gem "rack"
115
+ gem "actionpack"
116
+ G
117
+ bundle :cache
118
+ cached_gem("rack-1.0.0").should exist
119
+ cached_gem("actionpack-2.3.2").should exist
120
+ cached_gem("activesupport-2.3.2").should exist
121
+ end
122
+
123
+ it "re-caches during install" do
124
+ cached_gem("rack-1.0.0").rmtree
125
+ bundle :install
126
+ out.should include("Updating .gem files in vendor/cache")
127
+ cached_gem("rack-1.0.0").should exist
128
+ end
129
+
130
+ it "adds and removes when gems are updated" do
131
+ update_repo2
132
+ bundle 'update'
133
+ cached_gem("rack-1.2").should exist
134
+ cached_gem("rack-1.0.0").should_not exist
135
+ end
136
+
137
+ it "adds new gems and dependencies" do
138
+ install_gemfile <<-G
139
+ source "file://#{gem_repo2}"
140
+ gem "rails"
141
+ G
142
+ cached_gem("rails-2.3.2").should exist
143
+ cached_gem("activerecord-2.3.2").should exist
144
+ end
145
+
146
+ it "removes .gems for removed gems and dependencies" do
147
+ install_gemfile <<-G
148
+ source "file://#{gem_repo2}"
149
+ gem "rack"
150
+ G
151
+ cached_gem("rack-1.0.0").should exist
152
+ cached_gem("actionpack-2.3.2").should_not exist
153
+ cached_gem("activesupport-2.3.2").should_not exist
154
+ end
155
+
156
+ it "removes .gems when gem changes to git source" do
157
+ build_git "rack"
158
+
159
+ install_gemfile <<-G
160
+ source "file://#{gem_repo2}"
161
+ gem "rack", :git => "#{lib_path("rack-1.0")}"
162
+ gem "actionpack"
163
+ G
164
+ cached_gem("rack-1.0.0").should_not exist
165
+ cached_gem("actionpack-2.3.2").should exist
166
+ cached_gem("activesupport-2.3.2").should exist
167
+ end
168
+
169
+
170
+ it "doesn't remove gems that are for another platform" do
171
+ simulate_platform "java" do
172
+ install_gemfile <<-G
173
+ source "file://#{gem_repo1}"
174
+ gem "platform_specific"
175
+ G
176
+
177
+ bundle :cache
178
+ cached_gem("platform_specific-1.0-java").should exist
179
+ end
180
+
181
+ simulate_new_machine
182
+ install_gemfile <<-G
183
+ source "file://#{gem_repo1}"
184
+ gem "platform_specific"
185
+ G
186
+
187
+ cached_gem("platform_specific-1.0-#{Gem::Platform.local}").should exist
188
+ cached_gem("platform_specific-1.0-java").should exist
189
+ end
190
+
191
+ it "doesn't remove gems with mismatched :rubygems_version or :date" do
192
+ cached_gem("rack-1.0.0").rmtree
193
+ build_gem "rack", "1.0.0",
194
+ :path => bundled_app('vendor/cache'),
195
+ :rubygems_version => "1.3.2"
196
+ simulate_new_machine
197
+
198
+ bundle :install
199
+ cached_gem("rack-1.0.0").should exist
200
+ end
201
+
202
+ it "handles directories and non .gem files in the cache" do
203
+ bundled_app("vendor/cache/foo").mkdir
204
+ File.open(bundled_app("vendor/cache/bar"), 'w'){|f| f.write("not a gem") }
205
+ bundle :cache
206
+ end
207
+
208
+ it "does not say that it is removing gems when it isn't actually doing so" do
209
+ install_gemfile <<-G
210
+ source "file://#{gem_repo1}"
211
+ gem "rack"
212
+ G
213
+ bundle "cache"
214
+ bundle "install"
215
+ out.should_not =~ /removing/i
216
+ end
217
+
218
+ it "should install gems with the name bundler in them (that aren't bundler)" do
219
+ build_gem "foo-bundler", "1.0",
220
+ :path => bundled_app('vendor/cache')
221
+
222
+ install_gemfile <<-G
223
+ gem "foo-bundler"
224
+ G
225
+
226
+ should_be_installed "foo-bundler 1.0"
227
+ end
228
+ end
229
+
230
+ end
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+ describe "bundle cache with git" do
3
+ it "base_name should strip private repo uris" do
4
+ source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git")
5
+ source.send(:base_name).should == "bundler"
6
+ end
7
+
8
+ it "base_name should strip network share paths" do
9
+ source = Bundler::Source::Git.new("uri" => "//MachineName/ShareFolder")
10
+ source.send(:base_name).should == "ShareFolder"
11
+ end
12
+ end
@@ -0,0 +1,27 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle cache" do
4
+ describe "with path sources" do
5
+ it "is silent when the path is within the bundle" do
6
+ build_lib "foo", :path => bundled_app("lib/foo")
7
+
8
+ install_gemfile <<-G
9
+ gem "foo", :path => '#{bundled_app("lib/foo")}'
10
+ G
11
+
12
+ bundle "cache"
13
+ out.should == "Updating .gem files in vendor/cache"
14
+ end
15
+
16
+ it "warns when the path is outside of the bundle" do
17
+ build_lib "foo"
18
+
19
+ install_gemfile <<-G
20
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
21
+ G
22
+
23
+ bundle "cache"
24
+ out.should include("foo at `#{lib_path("foo-1.0")}` will not be cached")
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,57 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle cache with multiple platforms" do
4
+ before :each do
5
+ gemfile <<-G
6
+ source "file://#{gem_repo1}"
7
+
8
+ platforms :ruby, :ruby_18, :ruby_19 do
9
+ gem "rack", "1.0.0"
10
+ end
11
+
12
+ platforms :jruby do
13
+ gem "activesupport", "2.3.5"
14
+ end
15
+
16
+ platforms :mri, :mri_18, :mri_19 do
17
+ gem "activerecord", "2.3.2"
18
+ end
19
+ G
20
+
21
+ lockfile <<-G
22
+ GEM
23
+ remote: file:#{gem_repo1}/
24
+ specs:
25
+ rack (1.0.0)
26
+ activesupport (2.3.5)
27
+ activerecord (2.3.2)
28
+
29
+ PLATFORMS
30
+ ruby
31
+ java
32
+
33
+ DEPENDENCIES
34
+ rack (1.0.0)
35
+ activesupport (2.3.5)
36
+ activerecord (2.3.2)
37
+ G
38
+
39
+ cache_gems "rack-1.0.0", "activesupport-2.3.5", "activerecord-2.3.2"
40
+ end
41
+
42
+ it "ensures that bundle install does not delete gems for other platforms" do
43
+ bundle "install"
44
+
45
+ bundled_app("vendor/cache/rack-1.0.0.gem").should exist
46
+ bundled_app("vendor/cache/activesupport-2.3.5.gem").should exist
47
+ bundled_app("vendor/cache/activerecord-2.3.2.gem").should exist
48
+ end
49
+
50
+ it "ensures that bundle update does not delete gems for other platforms" do
51
+ bundle "update"
52
+
53
+ bundled_app("vendor/cache/rack-1.0.0.gem").should exist
54
+ bundled_app("vendor/cache/activesupport-2.3.5.gem").should exist
55
+ bundled_app("vendor/cache/activerecord-2.3.2.gem").should exist
56
+ end
57
+ end
@@ -0,0 +1,197 @@
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
+ out.should 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
+ out.should 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
+ exitstatus.should 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
+ exitstatus.should == 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
+ exitstatus.should == 0
54
+ end
55
+
56
+ describe "with an existing lockfile" do
57
+ before do
58
+ bundle "install"
59
+ end
60
+
61
+ it "works with the --deployment flag if you didn't change anything" do
62
+ bundle "install --deployment", :exitstatus => true
63
+ exitstatus.should == 0
64
+ end
65
+
66
+ it "works with the --frozen flag if you didn't change anything" do
67
+ bundle "install --frozen", :exitstatus => true
68
+ exitstatus.should == 0
69
+ end
70
+
71
+ it "explodes with the --deployment flag if you make a change and don't check in the lockfile" do
72
+ gemfile <<-G
73
+ source "file://#{gem_repo1}"
74
+ gem "rack"
75
+ gem "rack-obama"
76
+ G
77
+
78
+ bundle "install --deployment"
79
+ out.should include("deployment mode")
80
+ out.should include("You have added to the Gemfile")
81
+ out.should include("* rack-obama")
82
+ out.should_not include("You have deleted from the Gemfile")
83
+ out.should_not include("You have changed in the Gemfile")
84
+ end
85
+
86
+ it "can have --frozen set via an environment variable" do
87
+ gemfile <<-G
88
+ source "file://#{gem_repo1}"
89
+ gem "rack"
90
+ gem "rack-obama"
91
+ G
92
+
93
+ ENV['BUNDLE_FROZEN'] = '1'
94
+ bundle "install"
95
+ out.should include("deployment mode")
96
+ out.should include("You have added to the Gemfile")
97
+ out.should include("* rack-obama")
98
+ out.should_not include("You have deleted from the Gemfile")
99
+ out.should_not include("You have changed in the Gemfile")
100
+ end
101
+
102
+ it "explodes with the --frozen flag if you make a change and don't check in the lockfile" do
103
+ gemfile <<-G
104
+ source "file://#{gem_repo1}"
105
+ gem "rack"
106
+ gem "rack-obama"
107
+ G
108
+
109
+ bundle "install --frozen"
110
+ out.should include("deployment mode")
111
+ out.should include("You have added to the Gemfile")
112
+ out.should include("* rack-obama")
113
+ out.should_not include("You have deleted from the Gemfile")
114
+ out.should_not include("You have changed in the Gemfile")
115
+ end
116
+
117
+ it "explodes if you remove a gem and don't check in the lockfile" do
118
+ gemfile <<-G
119
+ source "file://#{gem_repo1}"
120
+ gem "activesupport"
121
+ G
122
+
123
+ bundle "install --deployment"
124
+ out.should include("deployment mode")
125
+ out.should include("You have added to the Gemfile:\n* activesupport\n\n")
126
+ out.should include("You have deleted from the Gemfile:\n* rack")
127
+ out.should_not include("You have changed in the Gemfile")
128
+ end
129
+
130
+ it "explodes if you add a source" do
131
+ gemfile <<-G
132
+ source "file://#{gem_repo1}"
133
+ gem "rack", :git => "git://hubz.com"
134
+ G
135
+
136
+ bundle "install --deployment"
137
+ out.should include("deployment mode")
138
+ out.should include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
139
+ out.should_not include("You have changed in the Gemfile")
140
+ end
141
+
142
+ it "explodes if you unpin a source" do
143
+ build_git "rack"
144
+
145
+ install_gemfile <<-G
146
+ source "file://#{gem_repo1}"
147
+ gem "rack", :git => "#{lib_path("rack-1.0")}"
148
+ G
149
+
150
+ gemfile <<-G
151
+ source "file://#{gem_repo1}"
152
+ gem "rack"
153
+ G
154
+
155
+ bundle "install --deployment"
156
+ out.should include("deployment mode")
157
+ out.should include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master)")
158
+ out.should_not include("You have added to the Gemfile")
159
+ out.should_not include("You have changed in the Gemfile")
160
+ end
161
+
162
+ it "explodes if you unpin a source, leaving it pinned somewhere else" do
163
+ build_lib "foo", :path => lib_path("rack/foo")
164
+ build_git "rack", :path => lib_path("rack")
165
+
166
+ install_gemfile <<-G
167
+ source "file://#{gem_repo1}"
168
+ gem "rack", :git => "#{lib_path("rack")}"
169
+ gem "foo", :git => "#{lib_path("rack")}"
170
+ G
171
+
172
+ gemfile <<-G
173
+ source "file://#{gem_repo1}"
174
+ gem "rack"
175
+ gem "foo", :git => "#{lib_path("rack")}"
176
+ G
177
+
178
+ bundle "install --deployment"
179
+ out.should include("deployment mode")
180
+ out.should include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`")
181
+ out.should_not include("You have added to the Gemfile")
182
+ out.should_not include("You have deleted from the Gemfile")
183
+ end
184
+
185
+ it "remembers that the bundle is frozen at runtime" do
186
+ bundle "install --deployment"
187
+
188
+ gemfile <<-G
189
+ source "file://#{gem_repo1}"
190
+ gem "rack", "1.0.0"
191
+ gem "rack-obama"
192
+ G
193
+
194
+ should_be_installed "rack 1.0.0"
195
+ end
196
+ end
197
+ end