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
@@ -14,7 +14,7 @@ describe "bundle install --standalone" do
14
14
  end
15
15
 
16
16
  it "generates a bundle/bundler/setup.rb" do
17
- bundled_app("bundle/bundler/setup.rb").should exist
17
+ expect(bundled_app("bundle/bundler/setup.rb")).to exist
18
18
  end
19
19
 
20
20
  it "makes the gems available without bundler" do
@@ -26,7 +26,7 @@ describe "bundle install --standalone" do
26
26
  puts ACTIONPACK
27
27
  RUBY
28
28
 
29
- out.should be == "2.3.2"
29
+ expect(out).to eq("2.3.2")
30
30
  end
31
31
 
32
32
  it "works on a different system" do
@@ -41,7 +41,7 @@ describe "bundle install --standalone" do
41
41
  puts ACTIONPACK
42
42
  RUBY
43
43
 
44
- out.should be == "2.3.2"
44
+ expect(out).to eq("2.3.2")
45
45
  end
46
46
  end
47
47
 
@@ -61,7 +61,7 @@ describe "bundle install --standalone" do
61
61
  end
62
62
 
63
63
  it "generates a bundle/bundler/setup.rb" do
64
- bundled_app("bundle/bundler/setup.rb").should exist
64
+ expect(bundled_app("bundle/bundler/setup.rb")).to exist
65
65
  end
66
66
 
67
67
  it "makes the gems available without bundler" do
@@ -75,7 +75,7 @@ describe "bundle install --standalone" do
75
75
  puts ACTIONPACK
76
76
  RUBY
77
77
 
78
- out.should be == "1.0\n2.3.2"
78
+ expect(out).to eq("1.0\n2.3.2")
79
79
  end
80
80
  end
81
81
 
@@ -107,7 +107,7 @@ describe "bundle install --standalone" do
107
107
  puts RACK_TEST
108
108
  RUBY
109
109
 
110
- out.should be == "2.3.2\n1.2.7\n1.0"
110
+ expect(out).to eq("2.3.2\n1.2.7\n1.0")
111
111
  end
112
112
 
113
113
  it "allows creating a standalone file with limited groups" do
@@ -122,8 +122,8 @@ describe "bundle install --standalone" do
122
122
  require "spec"
123
123
  RUBY
124
124
 
125
- out.should be == "2.3.2"
126
- err.should == "ZOMG LOAD ERROR"
125
+ expect(out).to eq("2.3.2")
126
+ expect(err).to eq("ZOMG LOAD ERROR")
127
127
  end
128
128
 
129
129
  it "allows --without to limit the groups used in a standalone" do
@@ -138,8 +138,8 @@ describe "bundle install --standalone" do
138
138
  require "spec"
139
139
  RUBY
140
140
 
141
- out.should be == "2.3.2"
142
- err.should == "ZOMG LOAD ERROR"
141
+ expect(out).to eq("2.3.2")
142
+ expect(err).to eq("ZOMG LOAD ERROR")
143
143
  end
144
144
 
145
145
  it "allows --path to change the location of the standalone bundle" do
@@ -153,7 +153,7 @@ describe "bundle install --standalone" do
153
153
  puts ACTIONPACK
154
154
  RUBY
155
155
 
156
- out.should == "2.3.2"
156
+ expect(out).to eq("2.3.2")
157
157
  end
158
158
 
159
159
  it "allows remembered --without to limit the groups used in a standalone" do
@@ -169,8 +169,8 @@ describe "bundle install --standalone" do
169
169
  require "spec"
170
170
  RUBY
171
171
 
172
- out.should be == "2.3.2"
173
- err.should == "ZOMG LOAD ERROR"
172
+ expect(out).to eq("2.3.2")
173
+ expect(err).to eq("ZOMG LOAD ERROR")
174
174
  end
175
175
  end
176
176
 
@@ -188,7 +188,7 @@ describe "bundle install --standalone" do
188
188
  it "should run without errors" do
189
189
  bundle "install --standalone", :artifice => "endpoint", :exitstatus => true
190
190
 
191
- @exitstatus.should be == 0
191
+ expect(@exitstatus).to eq(0)
192
192
  end
193
193
 
194
194
  it "still makes the gems available to normal bundler" do
@@ -200,7 +200,7 @@ describe "bundle install --standalone" do
200
200
  it "generates a bundle/bundler/setup.rb" do
201
201
  bundle "install --standalone", :artifice => "endpoint"
202
202
 
203
- bundled_app("bundle/bundler/setup.rb").should exist
203
+ expect(bundled_app("bundle/bundler/setup.rb")).to exist
204
204
  end
205
205
 
206
206
  it "makes the gems available without bundler" do
@@ -214,7 +214,7 @@ describe "bundle install --standalone" do
214
214
  puts ACTIONPACK
215
215
  RUBY
216
216
 
217
- out.should be == "2.3.2"
217
+ expect(out).to eq("2.3.2")
218
218
  end
219
219
 
220
220
  it "works on a different system" do
@@ -231,7 +231,7 @@ describe "bundle install --standalone" do
231
231
  puts ACTIONPACK
232
232
  RUBY
233
233
 
234
- out.should be == "2.3.2"
234
+ expect(out).to eq("2.3.2")
235
235
  end
236
236
  end
237
237
  end
@@ -246,14 +246,14 @@ describe "bundle install --standalone" do
246
246
 
247
247
  it "creates stubs that use the standalone load path" do
248
248
  Dir.chdir(bundled_app) do
249
- `bin/rails -v`.chomp.should eql "2.3.2"
249
+ expect(`bin/rails -v`.chomp).to eql "2.3.2"
250
250
  end
251
251
  end
252
252
 
253
253
  it "creates stubs that can be executed from anywhere" do
254
254
  require 'tmpdir'
255
255
  Dir.chdir(Dir.tmpdir) do
256
- `#{bundled_app}/bin/rails -v`.chomp.should eql "2.3.2"
256
+ expect(`#{bundled_app}/bin/rails -v`.chomp).to eql "2.3.2"
257
257
  end
258
258
  end
259
259
  end
@@ -13,11 +13,22 @@ describe "when using sudo", :sudo => true do
13
13
  gem "thin"
14
14
  G
15
15
 
16
- system_gem_path("gems/rack-1.0.0").should exist
17
- system_gem_path("gems/rack-1.0.0").stat.uid.should eq(0)
16
+ expect(system_gem_path("gems/rack-1.0.0")).to exist
17
+ expect(system_gem_path("gems/rack-1.0.0").stat.uid).to eq(0)
18
18
  should_be_installed "rack 1.0"
19
19
  end
20
20
 
21
+ it "installs rake and a gem dependent on rake in the same session" do
22
+ gemfile <<-G
23
+ source "file://#{gem_repo1}"
24
+ gem "rake"
25
+ gem "another_implicit_rake_dep"
26
+ G
27
+ bundle "install"
28
+ expect(system_gem_path("gems/another_implicit_rake_dep-1.0")).to exist
29
+ end
30
+
31
+
21
32
  it "installs when BUNDLE_PATH is owned by root" do
22
33
  bundle_path = tmp("owned_by_root")
23
34
  FileUtils.mkdir_p bundle_path
@@ -29,8 +40,8 @@ describe "when using sudo", :sudo => true do
29
40
  gem "rack", '1.0'
30
41
  G
31
42
 
32
- bundle_path.join("gems/rack-1.0.0").should exist
33
- bundle_path.join("gems/rack-1.0.0").stat.uid.should eq(0)
43
+ expect(bundle_path.join("gems/rack-1.0.0")).to exist
44
+ expect(bundle_path.join("gems/rack-1.0.0").stat.uid).to eq(0)
34
45
  should_be_installed "rack 1.0"
35
46
  end
36
47
 
@@ -45,25 +56,29 @@ describe "when using sudo", :sudo => true do
45
56
  gem "rack", '1.0'
46
57
  G
47
58
 
48
- default_bundle_path("gems/rack-1.0.0").should exist
59
+ expect(default_bundle_path("gems/rack-1.0.0")).to exist
49
60
  should_be_installed "rack 1.0"
50
61
  end
51
62
  end
52
63
 
53
- describe "and GEM_HOME is not writable" do
64
+ describe "and BUNDLE_PATH is not writable" do
54
65
  it "installs" do
55
- gem_home = tmp('sudo_gem_home')
56
- sudo "mkdir -p #{gem_home}"
57
- sudo "chmod ugo-w #{gem_home}"
66
+ begin
67
+ gem_home = tmp('sudo_gem_home')
58
68
 
59
- gemfile <<-G
60
- source "file://#{gem_repo1}"
61
- gem "rack", '1.0'
62
- G
69
+ sudo "mkdir -p #{gem_home}"
70
+ sudo "chmod ugo-w #{gem_home}"
71
+ ENV['GEM_HOME'] = gem_home.to_s
72
+ ENV['GEM_PATH'] = nil
73
+
74
+ install_gemfile <<-G
75
+ source "file://#{gem_repo1}"
76
+ gem "rack", '1.0'
77
+ G
63
78
 
64
- bundle :install, :env => {'GEM_HOME' => gem_home.to_s, 'GEM_PATH' => nil}
65
- gem_home.join('bin/rackup').should exist
66
- should_be_installed "rack 1.0", :env => {'GEM_HOME' => gem_home.to_s, 'GEM_PATH' => nil}
79
+ expect(gem_home.join('bin/rackup')).to exist
80
+ should_be_installed "rack 1.0"
81
+ end
67
82
  end
68
83
  end
69
84
 
@@ -21,6 +21,6 @@ describe "bundle install with win32-generated lockfile" do
21
21
 
22
22
  gem "rack"
23
23
  G
24
- @exitstatus.should == 0
24
+ expect(@exitstatus).to eq(0)
25
25
  end
26
26
  end
@@ -62,7 +62,7 @@ describe "bundle install from an existing gemspec" do
62
62
  source "file://#{gem_repo2}"
63
63
  gemspec :path => '#{tmp.join("foo")}'
64
64
  G
65
- error.should match(/There are no gemspecs at #{tmp.join('foo')}/)
65
+ expect(error).to match(/There are no gemspecs at #{tmp.join('foo')}/)
66
66
  end
67
67
 
68
68
  it "should raise if there are too many gemspecs available" do
@@ -74,7 +74,7 @@ describe "bundle install from an existing gemspec" do
74
74
  source "file://#{gem_repo2}"
75
75
  gemspec :path => '#{tmp.join("foo")}'
76
76
  G
77
- error.should match(/There are multiple gemspecs at #{tmp.join('foo')}/)
77
+ expect(error).to match(/There are multiple gemspecs at #{tmp.join('foo')}/)
78
78
  end
79
79
 
80
80
  it "should pick a specific gemspec" do
@@ -125,9 +125,9 @@ describe "bundle install from an existing gemspec" do
125
125
  # doesn't change. Exit codes should be used correctly (they can be more
126
126
  # than just 0 and 1).
127
127
  output = bundle("install --deployment")
128
- output.should_not match(/You have added to the Gemfile/)
129
- output.should_not match(/You have deleted from the Gemfile/)
130
- output.should_not match(/install in deployment mode after changing/)
128
+ expect(output).not_to match(/You have added to the Gemfile/)
129
+ expect(output).not_to match(/You have deleted from the Gemfile/)
130
+ expect(output).not_to match(/install in deployment mode after changing/)
131
131
  end
132
132
  end
133
133
 
@@ -140,7 +140,7 @@ describe "bundle install from an existing gemspec" do
140
140
  install_gemfile <<-G, :expect_err => true
141
141
  gemspec :path => '#{tmp.join("foo")}'
142
142
  G
143
- @err.should_not match(/ahh/)
143
+ expect(@err).not_to match(/ahh/)
144
144
  end
145
145
 
146
146
  context "when child gemspecs conflict with a released gemspec" do
@@ -23,11 +23,11 @@ describe "bundle install with git sources" do
23
23
  puts "WIN" unless defined?(FOO_PREV_REF)
24
24
  RUBY
25
25
 
26
- out.should == "WIN"
26
+ expect(out).to eq("WIN")
27
27
  end
28
28
 
29
29
  it "caches the git repo" do
30
- Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"].should have(1).item
30
+ expect(Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"]).to have(1).item
31
31
  end
32
32
 
33
33
  it "does not update the git source implicitly" do
@@ -47,14 +47,14 @@ describe "bundle install with git sources" do
47
47
  puts "fail" if defined?(FOO_PREV_REF)
48
48
  RUBY
49
49
 
50
- out.should be_empty
50
+ expect(out).to be_empty
51
51
  end
52
52
  end
53
53
 
54
54
  it "setups executables" do
55
55
  pending_jruby_shebang_fix
56
56
  bundle "exec foobar"
57
- out.should == "1.0"
57
+ expect(out).to eq("1.0")
58
58
  end
59
59
 
60
60
  it "complains if pinned specs don't exist in the git repo" do
@@ -64,7 +64,7 @@ describe "bundle install with git sources" do
64
64
  gem "foo", "1.1", :git => "#{lib_path('foo-1.0')}"
65
65
  G
66
66
 
67
- out.should include("Source contains 'foo' at: 1.0")
67
+ expect(out).to include("Source contains 'foo' at: 1.0")
68
68
  end
69
69
 
70
70
  it "still works after moving the application directory" do
@@ -136,7 +136,7 @@ describe "bundle install with git sources" do
136
136
  puts "WIN" unless defined?(FOO_PREV_REF)
137
137
  RUBY
138
138
 
139
- out.should == "WIN"
139
+ expect(out).to eq("WIN")
140
140
  end
141
141
 
142
142
  it "works when the revision is a symbol" do
@@ -145,14 +145,14 @@ describe "bundle install with git sources" do
145
145
  gem "foo"
146
146
  end
147
147
  G
148
- err.should eq("")
148
+ expect(err).to eq("")
149
149
 
150
150
  run <<-RUBY
151
151
  require 'foo'
152
152
  puts "WIN" unless defined?(FOO_PREV_REF)
153
153
  RUBY
154
154
 
155
- out.should == "WIN"
155
+ expect(out).to eq("WIN")
156
156
  end
157
157
  end
158
158
 
@@ -172,10 +172,10 @@ describe "bundle install with git sources" do
172
172
 
173
173
  bundle %|config local.rack #{lib_path('local-rack')}|
174
174
  bundle :install
175
- out.should =~ /at #{lib_path('local-rack')}/
175
+ expect(out).to match(/at #{lib_path('local-rack')}/)
176
176
 
177
177
  run "require 'rack'"
178
- out.should == "LOCAL"
178
+ expect(out).to eq("LOCAL")
179
179
  end
180
180
 
181
181
  it "chooses the local repository on runtime" do
@@ -194,7 +194,7 @@ describe "bundle install with git sources" do
194
194
 
195
195
  bundle %|config local.rack #{lib_path('local-rack')}|
196
196
  run "require 'rack'"
197
- out.should == "LOCAL"
197
+ expect(out).to eq("LOCAL")
198
198
  end
199
199
 
200
200
  it "updates specs on runtime" do
@@ -218,7 +218,7 @@ describe "bundle install with git sources" do
218
218
  run "require 'rack'"
219
219
 
220
220
  lockfile1 = File.read(bundled_app("Gemfile.lock"))
221
- lockfile1.should_not == lockfile0
221
+ expect(lockfile1).not_to eq(lockfile0)
222
222
  end
223
223
 
224
224
  it "updates ref on install" do
@@ -238,7 +238,7 @@ describe "bundle install with git sources" do
238
238
  bundle :install
239
239
 
240
240
  lockfile1 = File.read(bundled_app("Gemfile.lock"))
241
- lockfile1.should_not == lockfile0
241
+ expect(lockfile1).not_to eq(lockfile0)
242
242
  end
243
243
 
244
244
  it "explodes if given path does not exist on install" do
@@ -251,7 +251,7 @@ describe "bundle install with git sources" do
251
251
 
252
252
  bundle %|config local.rack #{lib_path('local-rack')}|
253
253
  bundle :install
254
- out.should =~ /Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/
254
+ expect(out).to match(/Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/)
255
255
  end
256
256
 
257
257
  it "explodes if branch is not given on install" do
@@ -265,7 +265,7 @@ describe "bundle install with git sources" do
265
265
 
266
266
  bundle %|config local.rack #{lib_path('local-rack')}|
267
267
  bundle :install
268
- out.should =~ /cannot use local override/i
268
+ expect(out).to match(/cannot use local override/i)
269
269
  end
270
270
 
271
271
  it "does not explode if disable_local_branch_check is given" do
@@ -280,7 +280,7 @@ describe "bundle install with git sources" do
280
280
  bundle %|config local.rack #{lib_path('local-rack')}|
281
281
  bundle %|config disable_local_branch_check true|
282
282
  bundle :install
283
- out.should =~ /Your bundle is complete!/
283
+ expect(out).to match(/Your bundle is complete!/)
284
284
  end
285
285
 
286
286
  it "explodes on different branches on install" do
@@ -299,7 +299,7 @@ describe "bundle install with git sources" do
299
299
 
300
300
  bundle %|config local.rack #{lib_path('local-rack')}|
301
301
  bundle :install
302
- out.should =~ /is using branch another but Gemfile specifies master/
302
+ expect(out).to match(/is using branch another but Gemfile specifies master/)
303
303
  end
304
304
 
305
305
  it "explodes on invalid revision on install" do
@@ -316,7 +316,7 @@ describe "bundle install with git sources" do
316
316
 
317
317
  bundle %|config local.rack #{lib_path('local-rack')}|
318
318
  bundle :install
319
- out.should =~ /The Gemfile lock is pointing to revision \w+/
319
+ expect(out).to match(/The Gemfile lock is pointing to revision \w+/)
320
320
  end
321
321
  end
322
322
 
@@ -365,7 +365,7 @@ describe "bundle install with git sources" do
365
365
  G
366
366
 
367
367
  run "require 'rack'"
368
- out.should == 'WIN OVERRIDE'
368
+ expect(out).to eq('WIN OVERRIDE')
369
369
  end
370
370
 
371
371
  it "correctly unlocks when changing to a git source" do
@@ -431,7 +431,7 @@ describe "bundle install with git sources" do
431
431
  puts "WIN" unless defined?(FOO_PREV_REF)
432
432
  RUBY
433
433
 
434
- out.should == "WIN"
434
+ expect(out).to eq("WIN")
435
435
  end
436
436
 
437
437
  it "correctly handles cases with invalid gemspecs" do
@@ -512,9 +512,9 @@ describe "bundle install with git sources" do
512
512
 
513
513
  bundle :install, :expect_err => true
514
514
 
515
- out.should include("Git error:")
516
- err.should include("fatal")
517
- err.should include("omgomg")
515
+ expect(out).to include("Git error:")
516
+ expect(err).to include("fatal")
517
+ expect(err).to include("omgomg")
518
518
  end
519
519
 
520
520
  it "works when the gem path has spaces in it" do
@@ -567,7 +567,7 @@ describe "bundle install with git sources" do
567
567
  gem "has_submodule"
568
568
  end
569
569
  G
570
- out.should =~ /could not find gem 'submodule/i
570
+ expect(out).to match(/could not find gem 'submodule/i)
571
571
 
572
572
  should_not_be_installed "has_submodule 1.0", :expect_err => true
573
573
  end
@@ -614,7 +614,7 @@ describe "bundle install with git sources" do
614
614
  puts "WIN" if FOO_PREV_REF == '#{git.ref_for("HEAD^^")}'
615
615
  RUBY
616
616
 
617
- out.should == "WIN"
617
+ expect(out).to eq("WIN")
618
618
  end
619
619
 
620
620
  it "does not to a remote fetch if the revision is cached locally" do
@@ -627,7 +627,7 @@ describe "bundle install with git sources" do
627
627
  FileUtils.rm_rf(lib_path('foo-1.0'))
628
628
 
629
629
  bundle "install"
630
- out.should_not =~ /updating/i
630
+ expect(out).not_to match(/updating/i)
631
631
  end
632
632
 
633
633
  it "doesn't blow up if bundle install is run twice in a row" do
@@ -639,7 +639,7 @@ describe "bundle install with git sources" do
639
639
 
640
640
  bundle "install"
641
641
  bundle "install", :exitstatus => true
642
- exitstatus.should == 0
642
+ expect(exitstatus).to eq(0)
643
643
  end
644
644
 
645
645
  it "does not duplicate git gem sources" do
@@ -655,7 +655,7 @@ describe "bundle install with git sources" do
655
655
  G
656
656
 
657
657
  bundle "install"
658
- File.read(bundled_app("Gemfile.lock")).scan('GIT').size.should == 1
658
+ expect(File.read(bundled_app("Gemfile.lock")).scan('GIT').size).to eq(1)
659
659
  end
660
660
 
661
661
  describe "switching sources" do
@@ -699,7 +699,7 @@ describe "bundle install with git sources" do
699
699
  G
700
700
 
701
701
  run "require 'new_file'"
702
- out.should == "USING GIT"
702
+ expect(out).to eq("USING GIT")
703
703
  end
704
704
  end
705
705
 
@@ -727,7 +727,7 @@ describe "bundle install with git sources" do
727
727
  puts VALIM_PREV_REF
728
728
  R
729
729
 
730
- out.should == old_revision
730
+ expect(out).to eq(old_revision)
731
731
  end
732
732
  end
733
733
 
@@ -743,7 +743,7 @@ describe "bundle install with git sources" do
743
743
  simulate_new_machine
744
744
 
745
745
  bundle "install --deployment", :exitstatus => true
746
- exitstatus.should == 0
746
+ expect(exitstatus).to eq(0)
747
747
  end
748
748
  end
749
749
 
@@ -765,7 +765,7 @@ describe "bundle install with git sources" do
765
765
 
766
766
  bundle :install, :expect_err => true,
767
767
  :requires => [lib_path('install_hooks.rb')]
768
- err.should == "Ran pre-install hook: foo-1.0"
768
+ expect(err).to eq("Ran pre-install hook: foo-1.0")
769
769
  end
770
770
 
771
771
  it "runs post-install hooks" do
@@ -785,7 +785,7 @@ describe "bundle install with git sources" do
785
785
 
786
786
  bundle :install, :expect_err => true,
787
787
  :requires => [lib_path('install_hooks.rb')]
788
- err.should == "Ran post-install hook: foo-1.0"
788
+ expect(err).to eq("Ran post-install hook: foo-1.0")
789
789
  end
790
790
 
791
791
  it "complains if the install hook fails" do
@@ -805,7 +805,7 @@ describe "bundle install with git sources" do
805
805
 
806
806
  bundle :install, :expect_err => true,
807
807
  :requires => [lib_path('install_hooks.rb')]
808
- out.should include("failed for foo-1.0")
808
+ expect(out).to include("failed for foo-1.0")
809
809
  end
810
810
  end
811
811
  end