bundler-maglev- 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 +30 -0
  11. data/lib/bundler.rb +286 -0
  12. data/lib/bundler/capistrano.rb +11 -0
  13. data/lib/bundler/cli.rb +520 -0
  14. data/lib/bundler/definition.rb +438 -0
  15. data/lib/bundler/dependency.rb +134 -0
  16. data/lib/bundler/deployment.rb +58 -0
  17. data/lib/bundler/dsl.rb +257 -0
  18. data/lib/bundler/environment.rb +47 -0
  19. data/lib/bundler/gem_helper.rb +151 -0
  20. data/lib/bundler/gem_installer.rb +9 -0
  21. data/lib/bundler/gem_tasks.rb +2 -0
  22. data/lib/bundler/graph.rb +130 -0
  23. data/lib/bundler/index.rb +138 -0
  24. data/lib/bundler/installer.rb +97 -0
  25. data/lib/bundler/lazy_specification.rb +74 -0
  26. data/lib/bundler/lockfile_parser.rb +108 -0
  27. data/lib/bundler/remote_specification.rb +59 -0
  28. data/lib/bundler/resolver.rb +464 -0
  29. data/lib/bundler/rubygems_ext.rb +237 -0
  30. data/lib/bundler/rubygems_integration.rb +349 -0
  31. data/lib/bundler/runtime.rb +152 -0
  32. data/lib/bundler/settings.rb +115 -0
  33. data/lib/bundler/setup.rb +23 -0
  34. data/lib/bundler/shared_helpers.rb +71 -0
  35. data/lib/bundler/source.rb +708 -0
  36. data/lib/bundler/spec_set.rb +135 -0
  37. data/lib/bundler/templates/Executable +16 -0
  38. data/lib/bundler/templates/Gemfile +4 -0
  39. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  40. data/lib/bundler/templates/newgem/Rakefile.tt +1 -0
  41. data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
  42. data/lib/bundler/templates/newgem/gitignore.tt +4 -0
  43. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -0
  44. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  45. data/lib/bundler/templates/newgem/newgem.gemspec.tt +24 -0
  46. data/lib/bundler/ui.rb +73 -0
  47. data/lib/bundler/vendor/thor.rb +358 -0
  48. data/lib/bundler/vendor/thor/actions.rb +314 -0
  49. data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
  50. data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
  51. data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
  52. data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
  53. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +270 -0
  54. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +109 -0
  55. data/lib/bundler/vendor/thor/base.rb +576 -0
  56. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
  57. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  58. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
  59. data/lib/bundler/vendor/thor/error.rb +30 -0
  60. data/lib/bundler/vendor/thor/group.rb +273 -0
  61. data/lib/bundler/vendor/thor/invocation.rb +168 -0
  62. data/lib/bundler/vendor/thor/parser.rb +4 -0
  63. data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
  64. data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
  65. data/lib/bundler/vendor/thor/parser/option.rb +120 -0
  66. data/lib/bundler/vendor/thor/parser/options.rb +175 -0
  67. data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
  68. data/lib/bundler/vendor/thor/runner.rb +309 -0
  69. data/lib/bundler/vendor/thor/shell.rb +88 -0
  70. data/lib/bundler/vendor/thor/shell/basic.rb +302 -0
  71. data/lib/bundler/vendor/thor/shell/color.rb +108 -0
  72. data/lib/bundler/vendor/thor/shell/html.rb +121 -0
  73. data/lib/bundler/vendor/thor/task.rb +113 -0
  74. data/lib/bundler/vendor/thor/util.rb +229 -0
  75. data/lib/bundler/vendor/thor/version.rb +3 -0
  76. data/lib/bundler/vendored_thor.rb +7 -0
  77. data/lib/bundler/version.rb +6 -0
  78. data/lib/bundler/vlad.rb +11 -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 +296 -0
data/man/index.txt ADDED
@@ -0,0 +1,6 @@
1
+ Gemfile(5) gemfile.5
2
+ bundle-install bundle-install.1
3
+ bundle-update bundle-update.1
4
+ bundle-package bundle-package.1
5
+ bundle-exec bundle-exec.1
6
+ bundle-config bundle-config.1
@@ -0,0 +1,143 @@
1
+ require "spec_helper"
2
+ require 'bundler/gem_helper'
3
+
4
+ describe "Bundler::GemHelper tasks" do
5
+ context "determining gemspec" do
6
+ it "interpolates the name when there is only one gemspec" do
7
+ bundle 'gem test'
8
+ app = bundled_app("test")
9
+ helper = Bundler::GemHelper.new(app.to_s)
10
+ helper.gemspec.name.should == 'test'
11
+ end
12
+
13
+ it "interpolates the name for a hidden gemspec" do
14
+ bundle 'gem test'
15
+ app = bundled_app("test")
16
+ FileUtils.mv app.join('test.gemspec'), app.join('.gemspec')
17
+ helper = Bundler::GemHelper.new(app.to_s)
18
+ helper.gemspec.name.should == 'test'
19
+ end
20
+
21
+ it "should fail when there is no gemspec" do
22
+ bundle 'gem test'
23
+ app = bundled_app("test")
24
+ FileUtils.rm(File.join(app.to_s, 'test.gemspec'))
25
+ proc { Bundler::GemHelper.new(app.to_s) }.should raise_error(/Unable to determine name/)
26
+ end
27
+
28
+ it "should fail when there are two gemspecs and the name isn't specified" do
29
+ bundle 'gem test'
30
+ app = bundled_app("test")
31
+ File.open(File.join(app.to_s, 'test2.gemspec'), 'w') {|f| f << ''}
32
+ proc { Bundler::GemHelper.new(app.to_s) }.should raise_error(/Unable to determine name/)
33
+ end
34
+
35
+ it "handles namespaces and converting to CamelCase" do
36
+ bundle 'gem test-foo_bar'
37
+ lib = bundled_app('test-foo_bar').join('lib/test-foo_bar.rb').read
38
+ lib.should include("module Test")
39
+ lib.should include("module FooBar")
40
+ end
41
+ end
42
+
43
+ context "gem management" do
44
+ def mock_confirm_message(message)
45
+ Bundler.ui.should_receive(:confirm).with(message)
46
+ end
47
+
48
+ def mock_build_message
49
+ mock_confirm_message "test 0.0.1 built to pkg/test-0.0.1.gem"
50
+ end
51
+
52
+ before(:each) do
53
+ bundle 'gem test'
54
+ @app = bundled_app("test")
55
+ @gemspec = File.read("#{@app.to_s}/test.gemspec")
56
+ File.open("#{@app.to_s}/test.gemspec", 'w'){|f| f << @gemspec.gsub('TODO: ', '') }
57
+ @helper = Bundler::GemHelper.new(@app.to_s)
58
+ end
59
+
60
+ it "uses a shell UI for output" do
61
+ Bundler.ui.should be_a(Bundler::UI::Shell)
62
+ end
63
+
64
+ describe 'build' do
65
+ it "builds" do
66
+ mock_build_message
67
+ @helper.build_gem
68
+ bundled_app('test/pkg/test-0.0.1.gem').should exist
69
+ end
70
+
71
+ it "raises an appropriate error when the build fails" do
72
+ # break the gemspec by adding back the TODOs...
73
+ File.open("#{@app.to_s}/test.gemspec", 'w'){|f| f << @gemspec }
74
+ proc { @helper.build_gem }.should raise_error(/TODO/)
75
+ end
76
+ end
77
+
78
+ describe 'install' do
79
+ it "installs" do
80
+ mock_build_message
81
+ mock_confirm_message "test (0.0.1) installed"
82
+ @helper.install_gem
83
+ bundled_app('test/pkg/test-0.0.1.gem').should exist
84
+ %x{gem list}.should include("test (0.0.1)")
85
+ end
86
+
87
+ it "raises an appropriate error when the install fails" do
88
+ @helper.should_receive(:build_gem) do
89
+ # write an invalid gem file, so we can simulate install failure...
90
+ FileUtils.mkdir_p(File.join(@app.to_s, 'pkg'))
91
+ path = "#{@app.to_s}/pkg/test-0.0.1.gem"
92
+ File.open(path, 'w'){|f| f << "not actually a gem"}
93
+ path
94
+ end
95
+ proc { @helper.install_gem }.should raise_error
96
+ end
97
+ end
98
+
99
+ describe 'release' do
100
+ it "shouldn't push if there are uncommitted files" do
101
+ proc { @helper.release_gem }.should raise_error(/files that need to be committed/)
102
+ end
103
+
104
+ it 'raises an appropriate error if there is no git remote' do
105
+ Bundler.ui.stub(:confirm => nil, :error => nil) # silence messages
106
+
107
+ Dir.chdir(gem_repo1) {
108
+ `git init --bare`
109
+ }
110
+ Dir.chdir(@app) {
111
+ `git init`
112
+ `git config user.email "you@example.com"`
113
+ `git config user.name "name"`
114
+ `git commit -a -m "initial commit"`
115
+ }
116
+
117
+ proc { @helper.release_gem }.should raise_error
118
+ end
119
+
120
+ it "releases" do
121
+ mock_build_message
122
+ mock_confirm_message(/Tagged v0.0.1/)
123
+ mock_confirm_message("Pushed git commits and tags")
124
+
125
+ @helper.should_receive(:rubygem_push).with(bundled_app('test/pkg/test-0.0.1.gem').to_s)
126
+
127
+ Dir.chdir(gem_repo1) {
128
+ `git init --bare`
129
+ }
130
+ Dir.chdir(@app) {
131
+ `git init`
132
+ `git config user.email "you@example.com"`
133
+ `git config user.name "name"`
134
+ `git remote add origin file://#{gem_repo1}`
135
+ `git commit -a -m "initial commit"`
136
+ sys_exec("git push origin master", true)
137
+ `git commit -a -m "another commit"`
138
+ }
139
+ @helper.release_gem
140
+ end
141
+ end
142
+ end
143
+ end
@@ -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