bundler 1.2.5 → 1.3.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 (124) hide show
  1. data/.gitignore +10 -7
  2. data/.travis.yml +12 -3
  3. data/CHANGELOG.md +26 -19
  4. data/CONTRIBUTE.md +97 -0
  5. data/README.md +4 -2
  6. data/Rakefile +17 -59
  7. data/bundler.gemspec +2 -1
  8. data/lib/bundler.rb +23 -20
  9. data/lib/bundler/cli.rb +68 -22
  10. data/lib/bundler/definition.rb +3 -2
  11. data/lib/bundler/deprecate.rb +15 -0
  12. data/lib/bundler/dsl.rb +14 -16
  13. data/lib/bundler/environment.rb +0 -5
  14. data/lib/bundler/fetcher.rb +23 -78
  15. data/lib/bundler/friendly_errors.rb +4 -5
  16. data/lib/bundler/gem_helper.rb +14 -16
  17. data/lib/bundler/injector.rb +64 -0
  18. data/lib/bundler/installer.rb +1 -7
  19. data/lib/bundler/lazy_specification.rb +6 -3
  20. data/lib/bundler/lockfile_parser.rb +25 -13
  21. data/lib/bundler/resolver.rb +0 -1
  22. data/lib/bundler/rubygems_integration.rb +83 -17
  23. data/lib/bundler/settings.rb +4 -2
  24. data/lib/bundler/similarity_detector.rb +63 -0
  25. data/lib/bundler/source.rb +3 -886
  26. data/lib/bundler/source/git.rb +267 -0
  27. data/lib/bundler/source/git/git_proxy.rb +142 -0
  28. data/lib/bundler/source/path.rb +209 -0
  29. data/lib/bundler/source/path/installer.rb +33 -0
  30. data/lib/bundler/source/rubygems.rb +261 -0
  31. data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -0
  32. data/lib/bundler/templates/newgem/rspec.tt +2 -0
  33. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
  34. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
  35. data/lib/bundler/templates/newgem/test/minitest_helper.rb.tt +4 -0
  36. data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +11 -0
  37. data/lib/bundler/ui.rb +20 -5
  38. data/lib/bundler/vendor/.document +0 -0
  39. data/lib/bundler/vendor/thor.rb +74 -5
  40. data/lib/bundler/vendor/thor/actions.rb +5 -5
  41. data/lib/bundler/vendor/thor/actions/directory.rb +1 -0
  42. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +7 -1
  43. data/lib/bundler/vendor/thor/base.rb +44 -11
  44. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +5 -0
  45. data/lib/bundler/vendor/thor/parser/argument.rb +14 -7
  46. data/lib/bundler/vendor/thor/parser/arguments.rb +7 -1
  47. data/lib/bundler/vendor/thor/parser/option.rb +8 -8
  48. data/lib/bundler/vendor/thor/parser/options.rb +62 -24
  49. data/lib/bundler/vendor/thor/runner.rb +1 -1
  50. data/lib/bundler/vendor/thor/shell/basic.rb +2 -2
  51. data/lib/bundler/vendor/thor/task.rb +2 -2
  52. data/lib/bundler/vendor/thor/version.rb +1 -1
  53. data/lib/bundler/vendored_persistent.rb +3 -15
  54. data/lib/bundler/version.rb +1 -1
  55. data/man/bundle-exec.ronn +1 -1
  56. data/man/bundle-update.ronn +1 -1
  57. data/man/bundle.ronn +4 -1
  58. data/spec/bundler/bundler_spec.rb +2 -28
  59. data/spec/bundler/cli_rspec.rb +9 -0
  60. data/spec/bundler/definition_spec.rb +1 -1
  61. data/spec/bundler/dsl_spec.rb +15 -8
  62. data/spec/bundler/gem_helper_spec.rb +38 -21
  63. data/spec/bundler/psyched_yaml_spec.rb +1 -0
  64. data/spec/bundler/source_spec.rb +3 -3
  65. data/spec/cache/gems_spec.rb +24 -24
  66. data/spec/cache/git_spec.rb +21 -23
  67. data/spec/cache/path_spec.rb +11 -11
  68. data/spec/cache/platform_spec.rb +6 -6
  69. data/spec/install/deploy_spec.rb +38 -38
  70. data/spec/install/gems/c_ext_spec.rb +2 -2
  71. data/spec/install/gems/dependency_api_spec.rb +23 -116
  72. data/spec/install/gems/env_spec.rb +1 -1
  73. data/spec/install/gems/flex_spec.rb +7 -8
  74. data/spec/install/gems/groups_spec.rb +10 -10
  75. data/spec/install/gems/packed_spec.rb +4 -4
  76. data/spec/install/gems/platform_spec.rb +3 -3
  77. data/spec/install/gems/post_install_spec.rb +9 -9
  78. data/spec/install/gems/resolving_spec.rb +2 -2
  79. data/spec/install/gems/simple_case_spec.rb +50 -53
  80. data/spec/install/gems/standalone_spec.rb +19 -19
  81. data/spec/install/gems/sudo_spec.rb +31 -16
  82. data/spec/install/gems/win32_spec.rb +1 -1
  83. data/spec/install/gemspec_spec.rb +6 -6
  84. data/spec/install/git_spec.rb +34 -34
  85. data/spec/install/invalid_spec.rb +3 -3
  86. data/spec/install/path_spec.rb +71 -8
  87. data/spec/install/upgrade_spec.rb +2 -2
  88. data/spec/integration/inject.rb +78 -0
  89. data/spec/lock/git_spec.rb +2 -2
  90. data/spec/lock/lockfile_spec.rb +14 -14
  91. data/spec/other/check_spec.rb +29 -29
  92. data/spec/other/clean_spec.rb +47 -48
  93. data/spec/other/config_spec.rb +20 -20
  94. data/spec/other/console_spec.rb +5 -5
  95. data/spec/other/exec_spec.rb +48 -28
  96. data/spec/other/ext_spec.rb +3 -3
  97. data/spec/other/help_spec.rb +6 -6
  98. data/spec/other/init_spec.rb +8 -8
  99. data/spec/other/newgem_spec.rb +95 -15
  100. data/spec/other/open_spec.rb +10 -5
  101. data/spec/other/outdated_spec.rb +8 -8
  102. data/spec/other/platform_spec.rb +45 -45
  103. data/spec/other/show_spec.rb +10 -10
  104. data/spec/quality_spec.rb +2 -2
  105. data/spec/realworld/dependency_api_spec.rb +61 -0
  106. data/spec/realworld/edgecases_spec.rb +8 -8
  107. data/spec/runtime/executable_spec.rb +13 -13
  108. data/spec/runtime/load_spec.rb +12 -12
  109. data/spec/runtime/platform_spec.rb +1 -1
  110. data/spec/runtime/require_spec.rb +24 -24
  111. data/spec/runtime/setup_spec.rb +113 -56
  112. data/spec/runtime/with_clean_env_spec.rb +11 -13
  113. data/spec/spec_helper.rb +6 -0
  114. data/spec/support/artifice/endpoint.rb +28 -13
  115. data/spec/support/artifice/endpoint_extra.rb +4 -0
  116. data/spec/support/builders.rb +1 -1
  117. data/spec/support/helpers.rb +2 -7
  118. data/spec/support/indexes.rb +3 -3
  119. data/spec/support/matchers.rb +6 -6
  120. data/spec/update/gems_spec.rb +19 -8
  121. data/spec/update/git_spec.rb +10 -10
  122. data/spec/update/source_spec.rb +1 -1
  123. metadata +86 -55
  124. data/.rspec +0 -2
@@ -104,4 +104,4 @@ describe "bundle install with ENV conditionals" do
104
104
  should_be_installed "rack 1.0"
105
105
  end
106
106
  end
107
- end
107
+ end
@@ -188,13 +188,12 @@ describe "bundle flex_install" do
188
188
  ruby <<-RUBY, :expect_err => true
189
189
  require 'bundler/setup'
190
190
  RUBY
191
- err.should =~ /could not find gem 'rack-obama/i
191
+ expect(err).to match(/could not find gem 'rack-obama/i)
192
192
  end
193
193
 
194
194
  it "suggests bundle update when the Gemfile requires different versions than the lock" do
195
195
  nice_error = <<-E.strip.gsub(/^ {8}/, '')
196
196
  Fetching source index from file:#{gem_repo2}/
197
- Resolving dependencies...
198
197
  Bundler could not find compatible versions for gem "rack":
199
198
  In snapshot (Gemfile.lock):
200
199
  rack (0.9.1)
@@ -208,7 +207,7 @@ describe "bundle flex_install" do
208
207
  E
209
208
 
210
209
  bundle :install
211
- out.should == nice_error
210
+ expect(out).to eq(nice_error)
212
211
  end
213
212
  end
214
213
 
@@ -228,13 +227,13 @@ describe "bundle flex_install" do
228
227
  end
229
228
 
230
229
  it "does something" do
231
- lambda {
230
+ expect {
232
231
  bundle "install"
233
- }.should_not change { File.read(bundled_app('Gemfile.lock')) }
232
+ }.not_to change { File.read(bundled_app('Gemfile.lock')) }
234
233
 
235
- out.should include('rack = 0.9.1')
236
- out.should include('locked at 1.0.0')
237
- out.should include('bundle update rack')
234
+ expect(out).to include('rack = 0.9.1')
235
+ expect(out).to include('locked at 1.0.0')
236
+ expect(out).to include('bundle update rack')
238
237
  end
239
238
 
240
239
  it "should work when you update" do
@@ -26,7 +26,7 @@ describe "bundle install with gem sources" do
26
26
  puts ACTIVESUPPORT
27
27
  R
28
28
 
29
- err.should == "ZOMG LOAD ERROR"
29
+ expect(err).to eq("ZOMG LOAD ERROR")
30
30
  end
31
31
 
32
32
  it "installs gems with inline :groups into those groups" do
@@ -37,18 +37,18 @@ describe "bundle install with gem sources" do
37
37
  puts THIN
38
38
  R
39
39
 
40
- err.should == "ZOMG LOAD ERROR"
40
+ expect(err).to eq("ZOMG LOAD ERROR")
41
41
  end
42
42
 
43
43
  it "sets up everything if Bundler.setup is used with no groups" do
44
44
  out = run("require 'rack'; puts RACK")
45
- out.should eq('1.0.0')
45
+ expect(out).to eq('1.0.0')
46
46
 
47
47
  out = run("require 'activesupport'; puts ACTIVESUPPORT")
48
- out.should eq('2.3.5')
48
+ expect(out).to eq('2.3.5')
49
49
 
50
50
  out = run("require 'thin'; puts THIN")
51
- out.should eq('1.0')
51
+ expect(out).to eq('1.0')
52
52
  end
53
53
 
54
54
  it "removes old groups when new groups are set up" do
@@ -58,7 +58,7 @@ describe "bundle install with gem sources" do
58
58
  puts THIN
59
59
  RUBY
60
60
 
61
- err.should == "ZOMG LOAD ERROR"
61
+ expect(err).to eq("ZOMG LOAD ERROR")
62
62
  end
63
63
 
64
64
  it "sets up old groups when they have previously been removed" do
@@ -67,7 +67,7 @@ describe "bundle install with gem sources" do
67
67
  Bundler.setup(:default, :emo)
68
68
  require 'thin'; puts THIN
69
69
  RUBY
70
- out.should == '1.0'
70
+ expect(out).to eq('1.0')
71
71
  end
72
72
  end
73
73
 
@@ -102,13 +102,13 @@ describe "bundle install with gem sources" do
102
102
 
103
103
  it "does not say it installed gems from the excluded group" do
104
104
  bundle :install, :without => "emo"
105
- out.should_not include("activesupport")
105
+ expect(out).not_to include("activesupport")
106
106
  end
107
107
 
108
108
  it "allows Bundler.setup for specific groups" do
109
109
  bundle :install, :without => "emo"
110
110
  run("require 'rack'; puts RACK", :default)
111
- out.should == '1.0.0'
111
+ expect(out).to eq('1.0.0')
112
112
  end
113
113
 
114
114
  it "does not effect the resolve" do
@@ -138,7 +138,7 @@ describe "bundle install with gem sources" do
138
138
  ENV["BUNDLE_WITHOUT"] = "emo"
139
139
 
140
140
  bundle :install
141
- out.should_not include("activesupport")
141
+ expect(out).not_to include("activesupport")
142
142
 
143
143
  should_be_installed "rack 1.0.0", :groups => [:default]
144
144
  should_not_be_installed "activesupport 2.3.5", :groups => [:default]
@@ -44,7 +44,7 @@ describe "bundle install with gem sources" do
44
44
  end
45
45
 
46
46
  bundle :install
47
- err.should be_empty
47
+ expect(err).to be_empty
48
48
  should_be_installed "rack 1.0"
49
49
  end
50
50
 
@@ -65,7 +65,7 @@ describe "bundle install with gem sources" do
65
65
  gem "platform_specific"
66
66
  G
67
67
  run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
68
- out.should == "1.0.0 RUBY"
68
+ expect(out).to eq("1.0.0 RUBY")
69
69
  end
70
70
  end
71
71
 
@@ -75,10 +75,10 @@ describe "bundle install with gem sources" do
75
75
  gem "rack"
76
76
  G
77
77
  bundled_app("vendor/cache").mkpath
78
- bundled_app("vendor/cache").children.should be_empty
78
+ expect(bundled_app("vendor/cache").children).to be_empty
79
79
 
80
80
  bundle "install --no-cache"
81
- bundled_app("vendor/cache").children.should be_empty
81
+ expect(bundled_app("vendor/cache").children).to be_empty
82
82
  end
83
83
  end
84
84
  end
@@ -96,7 +96,7 @@ describe "bundle install across platforms" do
96
96
 
97
97
  bundle "install --path vendor/bundle"
98
98
 
99
- vendored_gems("gems/rack-1.0.0").should exist
99
+ expect(vendored_gems("gems/rack-1.0.0")).to exist
100
100
  end
101
101
 
102
102
  it "works after switching Rubies" do
@@ -112,7 +112,7 @@ describe "bundle install across platforms" do
112
112
  FileUtils.mv(vendored_gems, bundled_app("vendor/bundle/#{Gem.ruby_engine}/#{new_version}"))
113
113
 
114
114
  bundle "install --path ./vendor/bundle"
115
- vendored_gems("gems/rack-1.0.0").should exist
115
+ expect(vendored_gems("gems/rack-1.0.0")).to exist
116
116
  end
117
117
  end
118
118
 
@@ -186,7 +186,7 @@ describe "bundle install with platform conditionals" do
186
186
  G
187
187
 
188
188
  bundle :show, :exitstatus => true
189
- exitstatus.should == 0
189
+ expect(exitstatus).to eq(0)
190
190
  end
191
191
 
192
192
  end
@@ -11,12 +11,12 @@ describe 'bundle install with gem sources' do
11
11
  G
12
12
 
13
13
  bundle :install
14
- out.should include("Post-install message from rack:")
15
- out.should include("Rack's post install message")
16
- out.should include("Post-install message from thin:")
17
- out.should include("Thin's post install message")
18
- out.should include("Post-install message from rack-obama:")
19
- out.should include("Rack-obama's post install message")
14
+ expect(out).to include("Post-install message from rack:")
15
+ expect(out).to include("Rack's post install message")
16
+ expect(out).to include("Post-install message from thin:")
17
+ expect(out).to include("Thin's post install message")
18
+ expect(out).to include("Post-install message from rack-obama:")
19
+ expect(out).to include("Rack-obama's post install message")
20
20
  end
21
21
  end
22
22
 
@@ -28,7 +28,7 @@ describe 'bundle install with gem sources' do
28
28
  G
29
29
 
30
30
  bundle :install
31
- out.should_not include("Post-install message")
31
+ expect(out).not_to include("Post-install message")
32
32
  end
33
33
  end
34
34
 
@@ -40,8 +40,8 @@ describe 'bundle install with gem sources' do
40
40
  G
41
41
 
42
42
  bundle :install
43
- out.should include("Post-install message from rack:")
44
- out.should include("Rack's post install message")
43
+ expect(out).to include("Post-install message from rack:")
44
+ expect(out).to include("Rack's post install message")
45
45
  end
46
46
  end
47
47
  end
@@ -16,7 +16,7 @@ describe "bundle install with gem sources" do
16
16
  puts IMPLICIT_RAKE_DEP
17
17
  puts ANOTHER_IMPLICIT_RAKE_DEP
18
18
  R
19
- out.should == "YES\nYES"
19
+ expect(out).to eq("YES\nYES")
20
20
  end
21
21
 
22
22
  it "installs gems with a dependency with no type" do
@@ -69,4 +69,4 @@ describe "bundle install with gem sources" do
69
69
  end
70
70
  end
71
71
  end
72
- end
72
+ end
@@ -8,7 +8,7 @@ describe "bundle install with gem sources" do
8
8
  G
9
9
 
10
10
  bundle :install
11
- out.should =~ /no dependencies/
11
+ expect(out).to match(/no dependencies/)
12
12
  end
13
13
 
14
14
  it "does not make a lockfile if the install fails" do
@@ -16,8 +16,8 @@ describe "bundle install with gem sources" do
16
16
  raise StandardError, "FAIL"
17
17
  G
18
18
 
19
- err.should =~ /FAIL \(StandardError\)/
20
- bundled_app("Gemfile.lock").should_not exist
19
+ expect(err).to match(/FAIL \(StandardError\)/)
20
+ expect(bundled_app("Gemfile.lock")).not_to exist
21
21
  end
22
22
 
23
23
  it "creates a Gemfile.lock" do
@@ -26,7 +26,7 @@ describe "bundle install with gem sources" do
26
26
  gem "rack"
27
27
  G
28
28
 
29
- bundled_app('Gemfile.lock').should exist
29
+ expect(bundled_app('Gemfile.lock')).to exist
30
30
  end
31
31
 
32
32
  it "creates lock files based on the Gemfile name" do
@@ -37,7 +37,7 @@ describe "bundle install with gem sources" do
37
37
 
38
38
  bundle 'install --gemfile OmgFile'
39
39
 
40
- bundled_app("OmgFile.lock").should exist
40
+ expect(bundled_app("OmgFile.lock")).to exist
41
41
  end
42
42
 
43
43
  it "doesn't delete the lockfile if one already exists" do
@@ -52,7 +52,7 @@ describe "bundle install with gem sources" do
52
52
  raise StandardError, "FAIL"
53
53
  G
54
54
 
55
- File.read(bundled_app("Gemfile.lock")).should == lockfile
55
+ expect(File.read(bundled_app("Gemfile.lock"))).to eq(lockfile)
56
56
  end
57
57
 
58
58
  it "does not touch the lockfile if nothing changed" do
@@ -61,7 +61,7 @@ describe "bundle install with gem sources" do
61
61
  gem "rack"
62
62
  G
63
63
 
64
- lambda { run '1' }.should_not change { File.mtime(bundled_app('Gemfile.lock')) }
64
+ expect { run '1' }.not_to change { File.mtime(bundled_app('Gemfile.lock')) }
65
65
  end
66
66
 
67
67
  it "fetches gems" do
@@ -70,7 +70,7 @@ describe "bundle install with gem sources" do
70
70
  gem 'rack'
71
71
  G
72
72
 
73
- default_bundle_path("gems/rack-1.0.0").should exist
73
+ expect(default_bundle_path("gems/rack-1.0.0")).to exist
74
74
  should_be_installed("rack 1.0.0")
75
75
  end
76
76
 
@@ -80,7 +80,7 @@ describe "bundle install with gem sources" do
80
80
  gem 'rack', "> 0.9", "< 1.0"
81
81
  G
82
82
 
83
- default_bundle_path("gems/rack-0.9.1").should exist
83
+ expect(default_bundle_path("gems/rack-0.9.1")).to exist
84
84
  should_be_installed("rack 0.9.1")
85
85
  end
86
86
 
@@ -90,7 +90,7 @@ describe "bundle install with gem sources" do
90
90
  gem 'rack', "< 1.0", "> 0.9"
91
91
  G
92
92
 
93
- default_bundle_path("gems/rack-0.9.1").should exist
93
+ expect(default_bundle_path("gems/rack-0.9.1")).to exist
94
94
  should_be_installed("rack 0.9.1")
95
95
  end
96
96
 
@@ -99,7 +99,7 @@ describe "bundle install with gem sources" do
99
99
  source "file://#{gem_repo1}"
100
100
  gem :rack
101
101
  G
102
- status.should == 4
102
+ expect(status).to eq(4)
103
103
  end
104
104
 
105
105
  it "pulls in dependencies" do
@@ -204,7 +204,7 @@ describe "bundle install with gem sources" do
204
204
  G
205
205
 
206
206
  run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
207
- out.should == "1.0.0 #{Gem::Platform.local}"
207
+ expect(out).to eq("1.0.0 #{Gem::Platform.local}")
208
208
  end
209
209
 
210
210
  it "falls back on plain ruby" do
@@ -215,7 +215,7 @@ describe "bundle install with gem sources" do
215
215
  G
216
216
 
217
217
  run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
218
- out.should == "1.0.0 RUBY"
218
+ expect(out).to eq("1.0.0 RUBY")
219
219
  end
220
220
 
221
221
  it "installs gems for java" do
@@ -226,7 +226,7 @@ describe "bundle install with gem sources" do
226
226
  G
227
227
 
228
228
  run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
229
- out.should == "1.0.0 JAVA"
229
+ expect(out).to eq("1.0.0 JAVA")
230
230
  end
231
231
 
232
232
  it "installs gems for windows" do
@@ -238,7 +238,7 @@ describe "bundle install with gem sources" do
238
238
  G
239
239
 
240
240
  run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
241
- out.should == "1.0.0 MSWIN"
241
+ expect(out).to eq("1.0.0 MSWIN")
242
242
  end
243
243
  end
244
244
 
@@ -291,14 +291,14 @@ describe "bundle install with gem sources" do
291
291
  G
292
292
 
293
293
  bundle :install, :expect_err => true
294
- out.should =~ /Your Gemfile has no remote sources/i
294
+ expect(out).to match(/Your Gemfile has no remote sources/i)
295
295
  end
296
296
 
297
297
  it "creates a Gemfile.lock on a blank Gemfile" do
298
298
  install_gemfile <<-G
299
299
  G
300
300
 
301
- File.exists?(bundled_app("Gemfile.lock")).should be_true
301
+ expect(File.exists?(bundled_app("Gemfile.lock"))).to be_true
302
302
  end
303
303
 
304
304
  it "gracefully handles error when rubygems server is unavailable" do
@@ -310,8 +310,8 @@ describe "bundle install with gem sources" do
310
310
  G
311
311
 
312
312
  bundle :install
313
- out.should include("Could not fetch specs from http://localhost:9384/")
314
- out.should_not include("file://")
313
+ expect(out).to include("Could not reach http://localhost:9384/")
314
+ expect(out).not_to include("file://")
315
315
  end
316
316
 
317
317
  it "doesn't blow up when the local .bundle/config is empty" do
@@ -323,7 +323,7 @@ describe "bundle install with gem sources" do
323
323
 
324
324
  gem 'foo'
325
325
  G
326
- exitstatus.should == 0
326
+ expect(exitstatus).to eq(0)
327
327
  end
328
328
 
329
329
  it "doesn't blow up when the global .bundle/config is empty" do
@@ -335,7 +335,7 @@ describe "bundle install with gem sources" do
335
335
 
336
336
  gem 'foo'
337
337
  G
338
- exitstatus.should == 0
338
+ expect(exitstatus).to eq(0)
339
339
  end
340
340
  end
341
341
 
@@ -358,7 +358,7 @@ describe "bundle install with gem sources" do
358
358
 
359
359
  bundle :install, :exitstatus => true
360
360
 
361
- exitstatus.should == 0
361
+ expect(exitstatus).to eq(0)
362
362
  end
363
363
  end
364
364
 
@@ -425,8 +425,8 @@ describe "bundle install with gem sources" do
425
425
  set_bundle_path(type, bundled_app("vendor2").to_s)
426
426
  bundle "install --path vendor/bundle"
427
427
 
428
- vendored_gems("gems/rack-1.0.0").should be_directory
429
- bundled_app("vendor2").should_not be_directory
428
+ expect(vendored_gems("gems/rack-1.0.0")).to be_directory
429
+ expect(bundled_app("vendor2")).not_to be_directory
430
430
  should_be_installed "rack 1.0.0"
431
431
  end
432
432
 
@@ -435,7 +435,7 @@ describe "bundle install with gem sources" do
435
435
 
436
436
  bundle :install
437
437
 
438
- bundled_app('vendor/gems/rack-1.0.0').should be_directory
438
+ expect(bundled_app('vendor/gems/rack-1.0.0')).to be_directory
439
439
  should_be_installed "rack 1.0.0"
440
440
  end
441
441
 
@@ -447,7 +447,7 @@ describe "bundle install with gem sources" do
447
447
  bundle :install
448
448
  end
449
449
 
450
- bundled_app('vendor/gems/rack-1.0.0').should be_directory
450
+ expect(bundled_app('vendor/gems/rack-1.0.0')).to be_directory
451
451
  should_be_installed "rack 1.0.0"
452
452
  end
453
453
  end
@@ -457,14 +457,14 @@ describe "bundle install with gem sources" do
457
457
 
458
458
  bundle :install
459
459
 
460
- vendored_gems('gems/rack-1.0.0').should be_directory
460
+ expect(vendored_gems('gems/rack-1.0.0')).to be_directory
461
461
  should_be_installed "rack 1.0.0"
462
462
  end
463
463
 
464
464
  it "sets BUNDLE_PATH as the first argument to bundle install" do
465
465
  bundle "install --path ./vendor/bundle"
466
466
 
467
- vendored_gems('gems/rack-1.0.0').should be_directory
467
+ expect(vendored_gems('gems/rack-1.0.0')).to be_directory
468
468
  should_be_installed "rack 1.0.0"
469
469
  end
470
470
 
@@ -473,7 +473,7 @@ describe "bundle install with gem sources" do
473
473
  build_gem "rack", "1.1.0", :to_system => true
474
474
  bundle "install --path ./vendor/bundle"
475
475
 
476
- vendored_gems('gems/rack-1.0.0').should be_directory
476
+ expect(vendored_gems('gems/rack-1.0.0')).to be_directory
477
477
  should_be_installed "rack 1.0.0"
478
478
  end
479
479
  end
@@ -500,7 +500,7 @@ describe "bundle install with gem sources" do
500
500
  G
501
501
 
502
502
  bundle :install, :quiet => true
503
- out.should == ""
503
+ expect(out).to eq("")
504
504
  end
505
505
 
506
506
  it "should still display warnings" do
@@ -509,7 +509,7 @@ describe "bundle install with gem sources" do
509
509
  G
510
510
 
511
511
  bundle :install, :quiet => true
512
- out.should =~ /Your Gemfile has no remote sources/
512
+ expect(out).to match(/Your Gemfile has no remote sources/)
513
513
  end
514
514
  end
515
515
 
@@ -528,9 +528,9 @@ describe "bundle install with gem sources" do
528
528
  it "behaves like bundle install vendor/bundle with --deployment" do
529
529
  bundle "install"
530
530
  bundle "install --deployment"
531
- out.should include("It was installed into ./vendor/bundle")
531
+ expect(out).to include("It was installed into ./vendor/bundle")
532
532
  should_be_installed "rack 1.0.0"
533
- bundled_app("vendor/bundle").should exist
533
+ expect(bundled_app("vendor/bundle")).to exist
534
534
  end
535
535
 
536
536
  it "does not use available system gems with bundle --path vendor/bundle" do
@@ -544,7 +544,7 @@ describe "bundle install with gem sources" do
544
544
 
545
545
  Dir.chdir(dir) do
546
546
  bundle "install --path vendor/bundle"
547
- out.should include("installed into ./vendor/bundle")
547
+ expect(out).to include("installed into ./vendor/bundle")
548
548
  end
549
549
 
550
550
  dir.rmtree
@@ -552,12 +552,12 @@ describe "bundle install with gem sources" do
552
552
 
553
553
  it "prints a warning to let the user know what has happened with bundle --path vendor/bundle" do
554
554
  bundle "install --path vendor/bundle"
555
- out.should include("It was installed into ./vendor")
555
+ expect(out).to include("It was installed into ./vendor")
556
556
  end
557
557
 
558
558
  it "disallows --path vendor/bundle --system" do
559
559
  bundle "install --path vendor/bundle --system"
560
- out.should include("Please choose.")
560
+ expect(out).to include("Please choose.")
561
561
  end
562
562
 
563
563
  it "remembers to disable system gems after the first time with bundle --path vendor/bundle" do
@@ -565,7 +565,7 @@ describe "bundle install with gem sources" do
565
565
  FileUtils.rm_rf bundled_app('vendor')
566
566
  bundle "install"
567
567
 
568
- vendored_gems('gems/rack-1.0.0').should be_directory
568
+ expect(vendored_gems('gems/rack-1.0.0')).to be_directory
569
569
  should_be_installed "rack 1.0.0"
570
570
  end
571
571
  end
@@ -590,8 +590,8 @@ describe "bundle install with gem sources" do
590
590
  end
591
591
  R
592
592
 
593
- out.should include("1.0")
594
- out.should include("no activesupport")
593
+ expect(out).to include("1.0")
594
+ expect(out).to include("no activesupport")
595
595
  end
596
596
  end
597
597
 
@@ -608,7 +608,7 @@ describe "bundle install with gem sources" do
608
608
  gem "yaml_spec"
609
609
  G
610
610
  bundle :install
611
- err.should be_empty
611
+ expect(err).to be_empty
612
612
  end
613
613
 
614
614
  it "still installs correctly when using path" do
@@ -617,7 +617,7 @@ describe "bundle install with gem sources" do
617
617
  install_gemfile <<-G
618
618
  gem 'yaml_spec', :path => "#{lib_path('yaml_spec-1.0')}"
619
619
  G
620
- err.should == ""
620
+ expect(err).to eq("")
621
621
  end
622
622
  end
623
623
 
@@ -658,7 +658,6 @@ describe "bundle install with gem sources" do
658
658
 
659
659
  nice_error = <<-E.strip.gsub(/^ {8}/, '')
660
660
  Fetching source index from file:#{gem_repo2}/
661
- Resolving dependencies...
662
661
  Bundler could not find compatible versions for gem "bundler":
663
662
  In Gemfile:
664
663
  bundler (= 0.9.2) ruby
@@ -666,7 +665,7 @@ describe "bundle install with gem sources" do
666
665
  Current Bundler version:
667
666
  bundler (#{Bundler::VERSION})
668
667
  E
669
- out.should include(nice_error)
668
+ expect(out).to include(nice_error)
670
669
  end
671
670
 
672
671
  it "works for gems with multiple versions in its dependencies" do
@@ -694,7 +693,7 @@ describe "bundle install with gem sources" do
694
693
  G
695
694
 
696
695
  run "begin; gem 'bundler'; puts 'WIN'; rescue Gem::LoadError; puts 'FAIL'; end"
697
- out.should == "WIN"
696
+ expect(out).to eq("WIN")
698
697
  end
699
698
 
700
699
  it "allows gem 'bundler' when Bundler is not in the Gemfile or its dependencies" do
@@ -704,7 +703,7 @@ describe "bundle install with gem sources" do
704
703
  G
705
704
 
706
705
  run "begin; gem 'bundler'; puts 'WIN'; rescue Gem::LoadError => e; puts e.backtrace; end"
707
- out.should == "WIN"
706
+ expect(out).to eq("WIN")
708
707
  end
709
708
 
710
709
  it "causes a conflict if child dependencies conflict" do
@@ -716,7 +715,6 @@ describe "bundle install with gem sources" do
716
715
 
717
716
  nice_error = <<-E.strip.gsub(/^ {8}/, '')
718
717
  Fetching source index from file:#{gem_repo2}/
719
- Resolving dependencies...
720
718
  Bundler could not find compatible versions for gem "activesupport":
721
719
  In Gemfile:
722
720
  activemerchant (>= 0) ruby depends on
@@ -725,7 +723,7 @@ describe "bundle install with gem sources" do
725
723
  rails_fail (>= 0) ruby depends on
726
724
  activesupport (1.2.3)
727
725
  E
728
- out.should == nice_error
726
+ expect(out).to eq(nice_error)
729
727
  end
730
728
 
731
729
  it "causes a conflict if a child dependency conflicts with the Gemfile" do
@@ -737,7 +735,6 @@ describe "bundle install with gem sources" do
737
735
 
738
736
  nice_error = <<-E.strip.gsub(/^ {8}/, '')
739
737
  Fetching source index from file:#{gem_repo2}/
740
- Resolving dependencies...
741
738
  Bundler could not find compatible versions for gem "activesupport":
742
739
  In Gemfile:
743
740
  rails_fail (>= 0) ruby depends on
@@ -745,7 +742,7 @@ describe "bundle install with gem sources" do
745
742
 
746
743
  activesupport (2.3.5)
747
744
  E
748
- out.should == nice_error
745
+ expect(out).to eq(nice_error)
749
746
  end
750
747
 
751
748
  it "can install dependencies even if " do
@@ -758,7 +755,7 @@ describe "bundle install with gem sources" do
758
755
  #simulate_new_machine
759
756
 
760
757
  bundle "check"
761
- out.should == "The Gemfile's dependencies are satisfied"
758
+ expect(out).to eq("The Gemfile's dependencies are satisfied")
762
759
  end
763
760
  end
764
761
 
@@ -791,7 +788,7 @@ describe "bundle install with gem sources" do
791
788
  it "does not hit the remote a second time" do
792
789
  FileUtils.rm_rf gem_repo2
793
790
  bundle "install --without rack"
794
- err.should be_empty
791
+ expect(err).to be_empty
795
792
  end
796
793
  end
797
794
 
@@ -799,7 +796,7 @@ describe "bundle install with gem sources" do
799
796
  # On OS X, Gem.bindir defaults to /usr/bin, so system_bindir is useful if
800
797
  # you want to avoid sudo installs for system gems with OS X's default ruby
801
798
  it "overrides Gem.bindir" do
802
- Pathname.new("/usr/bin").should_not be_writable
799
+ expect(Pathname.new("/usr/bin")).not_to be_writable unless Process::euid == 0
803
800
  gemfile <<-G
804
801
  require 'rubygems'
805
802
  def Gem.bindir; "/usr/bin"; end
@@ -810,7 +807,7 @@ describe "bundle install with gem sources" do
810
807
  config "BUNDLE_SYSTEM_BINDIR" => system_gem_path('altbin').to_s
811
808
  bundle :install
812
809
  should_be_installed "rack 1.0.0"
813
- system_gem_path("altbin/rackup").should exist
810
+ expect(system_gem_path("altbin/rackup")).to exist
814
811
  end
815
812
  end
816
813