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
@@ -0,0 +1,259 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle install with gem sources" do
4
+ describe "with groups" do
5
+ describe "installing with no options" do
6
+ before :each do
7
+ install_gemfile <<-G
8
+ source "file://#{gem_repo1}"
9
+ gem "rack"
10
+ group :emo do
11
+ gem "activesupport", "2.3.5"
12
+ end
13
+ gem "thin", :groups => [:emo]
14
+ G
15
+ end
16
+
17
+ it "installs gems in the default group" do
18
+ should_be_installed "rack 1.0.0"
19
+ end
20
+
21
+ it "installs gems in a group block into that group" do
22
+ should_be_installed "activesupport 2.3.5"
23
+
24
+ run("require 'activesupport'; puts ACTIVESUPPORT",
25
+ :default, :expect_err => true)
26
+ @err.should =~ /no such file to load -- activesupport/
27
+ end
28
+
29
+ it "installs gems with inline :groups into those groups" do
30
+ should_be_installed "thin 1.0"
31
+
32
+ run("require 'thin'; puts THIN", :default, :expect_err => true)
33
+ @err.should =~ /no such file to load -- thin/
34
+ end
35
+
36
+ it "sets up everything if Bundler.setup is used with no groups" do
37
+ out = run("require 'rack'; puts RACK")
38
+ out.should eq('1.0.0')
39
+
40
+ out = run("require 'activesupport'; puts ACTIVESUPPORT")
41
+ out.should eq('2.3.5')
42
+
43
+ out = run("require 'thin'; puts THIN")
44
+ out.should eq('1.0')
45
+ end
46
+
47
+ it "removes old groups when new groups are set up" do
48
+ run <<-RUBY, :emo, :expect_err => true
49
+ Bundler.setup(:default)
50
+ require 'thin'; puts THIN
51
+ RUBY
52
+ @err.should =~ /no such file to load -- thin/i
53
+ end
54
+
55
+ it "sets up old groups when they have previously been removed" do
56
+ out = run <<-RUBY, :emo
57
+ Bundler.setup(:default)
58
+ Bundler.setup(:default, :emo)
59
+ require 'thin'; puts THIN
60
+ RUBY
61
+ out.should == '1.0'
62
+ end
63
+ end
64
+
65
+ describe "installing --without" do
66
+ describe "with gems assigned to a single group" do
67
+ before :each do
68
+ gemfile <<-G
69
+ source "file://#{gem_repo1}"
70
+ gem "rack"
71
+ group :emo do
72
+ gem "activesupport", "2.3.5"
73
+ end
74
+ G
75
+ end
76
+
77
+ it "installs gems in the default group" do
78
+ bundle :install, :without => "emo"
79
+ should_be_installed "rack 1.0.0", :groups => [:default]
80
+ end
81
+
82
+ it "does not install gems from the excluded group" do
83
+ bundle :install, :without => "emo"
84
+ should_not_be_installed "activesupport 2.3.5", :groups => [:default]
85
+ end
86
+
87
+ it "does not install gems from the previously excluded group" do
88
+ bundle :install, :without => "emo"
89
+ should_not_be_installed "activesupport 2.3.5"
90
+ bundle :install
91
+ should_not_be_installed "activesupport 2.3.5"
92
+ end
93
+
94
+ it "does not say it installed gems from the excluded group" do
95
+ bundle :install, :without => "emo"
96
+ out.should_not include("activesupport")
97
+ end
98
+
99
+ it "allows Bundler.setup for specific groups" do
100
+ bundle :install, :without => "emo"
101
+ run("require 'rack'; puts RACK", :default)
102
+ out.should == '1.0.0'
103
+ end
104
+
105
+ it "does not effect the resolve" do
106
+ gemfile <<-G
107
+ source "file://#{gem_repo1}"
108
+ gem "activesupport"
109
+ group :emo do
110
+ gem "rails", "2.3.2"
111
+ end
112
+ G
113
+
114
+ bundle :install, :without => "emo"
115
+ should_be_installed "activesupport 2.3.2", :groups => [:default]
116
+ end
117
+
118
+ it "still works on a different machine and excludes gems" do
119
+ bundle :install, :without => "emo"
120
+
121
+ simulate_new_machine
122
+ bundle :install, :without => "emo"
123
+
124
+ should_be_installed "rack 1.0.0", :groups => [:default]
125
+ should_not_be_installed "activesupport 2.3.5", :groups => [:default]
126
+ end
127
+
128
+ it "still works when BUNDLE_WITHOUT is set" do
129
+ ENV["BUNDLE_WITHOUT"] = "emo"
130
+
131
+ bundle :install
132
+ out.should_not include("activesupport")
133
+
134
+ should_be_installed "rack 1.0.0", :groups => [:default]
135
+ should_not_be_installed "activesupport 2.3.5", :groups => [:default]
136
+
137
+ ENV["BUNDLE_WITHOUT"] = nil
138
+ end
139
+
140
+ it "clears without when passed an empty list" do
141
+ bundle :install, :without => "emo"
142
+
143
+ bundle 'install --without ""'
144
+ should_be_installed "activesupport 2.3.5"
145
+ end
146
+
147
+ it "doesn't clear without when nothing is passed" do
148
+ bundle :install, :without => "emo"
149
+
150
+ bundle :install
151
+ should_not_be_installed "activesupport 2.3.5"
152
+ end
153
+ end
154
+
155
+ describe "with gems assigned to multiple groups" do
156
+ before :each do
157
+ gemfile <<-G
158
+ source "file://#{gem_repo1}"
159
+ gem "rack"
160
+ group :emo, :lolercoaster do
161
+ gem "activesupport", "2.3.5"
162
+ end
163
+ G
164
+ end
165
+
166
+ it "installs gems in the default group" do
167
+ bundle :install, :without => "emo lolercoaster"
168
+ should_be_installed "rack 1.0.0"
169
+ end
170
+
171
+ it "installs the gem if any of its groups are installed" do
172
+ bundle "install --without emo"
173
+ should_be_installed "rack 1.0.0", "activesupport 2.3.5"
174
+ end
175
+
176
+ it "works when locked as well" do
177
+ bundle "install --without emo"
178
+ bundle "lock"
179
+
180
+ simulate_new_machine
181
+
182
+ bundle "install --without lolercoaster"
183
+ should_be_installed "rack 1.0.0", "activesupport 2.3.5"
184
+ end
185
+
186
+ describe "with a gem defined multiple times in different groups" do
187
+ before :each do
188
+ gemfile <<-G
189
+ source "file://#{gem_repo1}"
190
+ gem "rack"
191
+
192
+ group :emo do
193
+ gem "activesupport", "2.3.5"
194
+ end
195
+
196
+ group :lolercoaster do
197
+ gem "activesupport", "2.3.5"
198
+ end
199
+ G
200
+ end
201
+
202
+ it "installs the gem w/ option --without emo" do
203
+ bundle "install --without emo"
204
+ should_be_installed "activesupport 2.3.5"
205
+ end
206
+
207
+ it "installs the gem w/ option --without lolercoaster" do
208
+ bundle "install --without lolercoaster"
209
+ should_be_installed "activesupport 2.3.5"
210
+ end
211
+
212
+ it "does not install the gem w/ option --without emo lolercoaster" do
213
+ bundle "install --without emo lolercoaster"
214
+ should_not_be_installed "activesupport 2.3.5"
215
+ end
216
+
217
+ it "does not install the gem w/ option --without 'emo lolercoaster'" do
218
+ bundle "install --without 'emo lolercoaster'"
219
+ should_not_be_installed "activesupport 2.3.5"
220
+ end
221
+ end
222
+ end
223
+
224
+ describe "nesting groups" do
225
+ before :each do
226
+ gemfile <<-G
227
+ source "file://#{gem_repo1}"
228
+ gem "rack"
229
+ group :emo do
230
+ group :lolercoaster do
231
+ gem "activesupport", "2.3.5"
232
+ end
233
+ end
234
+ G
235
+ end
236
+
237
+ it "installs gems in the default group" do
238
+ bundle :install, :without => "emo lolercoaster"
239
+ should_be_installed "rack 1.0.0"
240
+ end
241
+
242
+ it "installs the gem if any of its groups are installed" do
243
+ bundle "install --without emo"
244
+ should_be_installed "rack 1.0.0", "activesupport 2.3.5"
245
+ end
246
+
247
+ it "works when locked as well" do
248
+ bundle "install --without emo"
249
+ bundle "lock"
250
+
251
+ simulate_new_machine
252
+
253
+ bundle "install --without lolercoaster"
254
+ should_be_installed "rack 1.0.0", "activesupport 2.3.5"
255
+ end
256
+ end
257
+ end
258
+ end
259
+ end
@@ -0,0 +1,84 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle install with gem sources" do
4
+ describe "when cached and locked" do
5
+ it "does not hit the remote at all" do
6
+ build_repo2
7
+ install_gemfile <<-G
8
+ source "file://#{gem_repo2}"
9
+ gem "rack"
10
+ G
11
+
12
+ bundle :pack
13
+ simulate_new_machine
14
+ FileUtils.rm_rf gem_repo2
15
+
16
+ bundle "install --local"
17
+ should_be_installed "rack 1.0.0"
18
+ end
19
+
20
+ it "does not hit the remote at all" do
21
+ build_repo2
22
+ install_gemfile <<-G
23
+ source "file://#{gem_repo2}"
24
+ gem "rack"
25
+ G
26
+
27
+ bundle :pack
28
+ simulate_new_machine
29
+ FileUtils.rm_rf gem_repo2
30
+
31
+ bundle "install --deployment"
32
+ should_be_installed "rack 1.0.0"
33
+ end
34
+
35
+ it "does not reinstall already-installed gems" do
36
+ install_gemfile <<-G
37
+ source "file://#{gem_repo1}"
38
+ gem "rack"
39
+ G
40
+ bundle :pack
41
+
42
+ build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
43
+ s.write "lib/rack.rb", "raise 'omg'"
44
+ end
45
+
46
+ bundle :install
47
+ err.should be_empty
48
+ should_be_installed "rack 1.0"
49
+ end
50
+
51
+ it "ignores cached gems for the wrong platform" do
52
+ simulate_platform "java" do
53
+ install_gemfile <<-G
54
+ source "file://#{gem_repo1}"
55
+ gem "platform_specific"
56
+ G
57
+ bundle :pack
58
+ end
59
+
60
+ simulate_new_machine
61
+
62
+ simulate_platform "ruby" do
63
+ install_gemfile <<-G
64
+ source "file://#{gem_repo1}"
65
+ gem "platform_specific"
66
+ G
67
+ run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
68
+ out.should == "1.0.0 RUBY"
69
+ end
70
+ end
71
+
72
+ it "does not update the cache if --no-cache is passed" do
73
+ gemfile <<-G
74
+ source "file://#{gem_repo1}"
75
+ gem "rack"
76
+ G
77
+ bundled_app("vendor/cache").mkpath
78
+ bundled_app("vendor/cache").children.should be_empty
79
+
80
+ bundle "install --no-cache"
81
+ bundled_app("vendor/cache").children.should be_empty
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,192 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle install across platforms" do
4
+ it "maintains the same lockfile if all gems are compatible across platforms" do
5
+ lockfile <<-G
6
+ GEM
7
+ remote: file:#{gem_repo1}/
8
+ specs:
9
+ rack (0.9.1)
10
+
11
+ PLATFORMS
12
+ #{not_local}
13
+
14
+ DEPENDENCIES
15
+ rack
16
+ G
17
+
18
+ install_gemfile <<-G
19
+ source "file://#{gem_repo1}"
20
+
21
+ gem "rack"
22
+ G
23
+
24
+ should_be_installed "rack 0.9.1"
25
+ end
26
+
27
+ it "pulls in the correct platform specific gem" do
28
+ lockfile <<-G
29
+ GEM
30
+ remote: file:#{gem_repo1}
31
+ specs:
32
+ platform_specific (1.0)
33
+ platform_specific (1.0-java)
34
+ platform_specific (1.0-x86-mswin32)
35
+
36
+ PLATFORMS
37
+ ruby
38
+
39
+ DEPENDENCIES
40
+ platform_specific
41
+ G
42
+
43
+ simulate_platform "java"
44
+ install_gemfile <<-G
45
+ source "file://#{gem_repo1}"
46
+
47
+ gem "platform_specific"
48
+ G
49
+
50
+ should_be_installed "platform_specific 1.0 JAVA"
51
+ end
52
+
53
+ it "works with gems that have different dependencies" do
54
+ simulate_platform "java"
55
+ install_gemfile <<-G
56
+ source "file://#{gem_repo1}"
57
+
58
+ gem "nokogiri"
59
+ G
60
+
61
+ should_be_installed "nokogiri 1.4.2 JAVA", "weakling 0.0.3"
62
+
63
+ simulate_new_machine
64
+
65
+ simulate_platform "ruby"
66
+ install_gemfile <<-G
67
+ source "file://#{gem_repo1}"
68
+
69
+ gem "nokogiri"
70
+ G
71
+
72
+ should_be_installed "nokogiri 1.4.2"
73
+ should_not_be_installed "weakling"
74
+ end
75
+
76
+ it "works the other way with gems that have different dependencies" do
77
+ simulate_platform "ruby"
78
+ install_gemfile <<-G
79
+ source "file://#{gem_repo1}"
80
+
81
+ gem "nokogiri"
82
+ G
83
+
84
+ simulate_platform "java"
85
+ bundle "install"
86
+
87
+ should_be_installed "nokogiri 1.4.2 JAVA", "weakling 0.0.3"
88
+ end
89
+
90
+ it "fetches gems again after changing the version of Ruby" do
91
+ gemfile <<-G
92
+ source "file://#{gem_repo1}"
93
+
94
+ gem "rack", "1.0.0"
95
+ G
96
+
97
+ bundle "install --path vendor/bundle"
98
+
99
+ vendored_gems("gems/rack-1.0.0").should exist
100
+ end
101
+
102
+ it "works after switching Rubies" do
103
+ gemfile <<-G
104
+ source "file://#{gem_repo1}"
105
+
106
+ gem "rack", "1.0.0"
107
+ G
108
+
109
+ bundle "install --path vendor/bundle"
110
+
111
+ new_version = Gem::ConfigMap[:ruby_version] == "1.8" ? "1.9.1" : "1.8"
112
+ FileUtils.mv(vendored_gems, bundled_app("vendor/bundle/#{Gem.ruby_engine}/#{new_version}"))
113
+
114
+ bundle "install --path ./vendor/bundle"
115
+ vendored_gems("gems/rack-1.0.0").should exist
116
+ end
117
+ end
118
+
119
+ describe "bundle install with platform conditionals" do
120
+ it "installs gems tagged w/ the current platforms" do
121
+ install_gemfile <<-G
122
+ source "file://#{gem_repo1}"
123
+
124
+ platforms :#{local_tag} do
125
+ gem "nokogiri"
126
+ end
127
+ G
128
+
129
+ should_be_installed "nokogiri 1.4.2"
130
+ end
131
+
132
+ it "does not install gems tagged w/ another platforms" do
133
+ install_gemfile <<-G
134
+ source "file://#{gem_repo1}"
135
+ gem "rack"
136
+ platforms :#{not_local_tag} do
137
+ gem "nokogiri"
138
+ end
139
+ G
140
+
141
+ should_be_installed "rack 1.0"
142
+ should_not_be_installed "nokogiri 1.4.2"
143
+ end
144
+
145
+ it "installs gems tagged w/ the current platforms inline" do
146
+ install_gemfile <<-G
147
+ source "file://#{gem_repo1}"
148
+ gem "nokogiri", :platforms => :#{local_tag}
149
+ G
150
+ should_be_installed "nokogiri 1.4.2"
151
+ end
152
+
153
+ it "does not install gems tagged w/ another platforms inline" do
154
+ install_gemfile <<-G
155
+ source "file://#{gem_repo1}"
156
+ gem "rack"
157
+ gem "nokogiri", :platforms => :#{not_local_tag}
158
+ G
159
+ should_be_installed "rack 1.0"
160
+ should_not_be_installed "nokogiri 1.4.2"
161
+ end
162
+
163
+ it "installs gems tagged w/ the current platform inline" do
164
+ install_gemfile <<-G
165
+ source "file://#{gem_repo1}"
166
+ gem "nokogiri", :platform => :#{local_tag}
167
+ G
168
+ should_be_installed "nokogiri 1.4.2"
169
+ end
170
+
171
+ it "doesn't install gems tagged w/ another platform inline" do
172
+ install_gemfile <<-G
173
+ source "file://#{gem_repo1}"
174
+ gem "nokogiri", :platform => :#{not_local_tag}
175
+ G
176
+ should_not_be_installed "nokogiri 1.4.2"
177
+ end
178
+
179
+ it "does not blow up on sources with all platform-excluded specs" do
180
+ build_git "foo"
181
+
182
+ install_gemfile <<-G
183
+ platform :#{not_local_tag} do
184
+ gem "foo", :git => "#{lib_path('foo-1.0')}"
185
+ end
186
+ G
187
+
188
+ bundle :show, :exitstatus => true
189
+ exitstatus.should == 0
190
+ end
191
+
192
+ end