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
@@ -13,7 +13,7 @@ describe "bundle show" do
13
13
 
14
14
  bundle "show"
15
15
 
16
- bundled_app("Gemfile.lock").should exist
16
+ expect(bundled_app("Gemfile.lock")).to exist
17
17
  end
18
18
 
19
19
  it "creates a Gemfile.lock when invoked with a gem name" do
@@ -21,28 +21,28 @@ describe "bundle show" do
21
21
 
22
22
  bundle "show rails"
23
23
 
24
- bundled_app("Gemfile.lock").should exist
24
+ expect(bundled_app("Gemfile.lock")).to exist
25
25
  end
26
26
 
27
27
  it "prints path if gem exists in bundle" do
28
28
  bundle "show rails"
29
- out.should == default_bundle_path('gems', 'rails-2.3.2').to_s
29
+ expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
30
30
  end
31
31
 
32
32
  it "prints the path to the running bundler" do
33
33
  bundle "show bundler"
34
- out.should == File.expand_path('../../../', __FILE__)
34
+ expect(out).to eq(File.expand_path('../../../', __FILE__))
35
35
  end
36
36
 
37
37
  it "complains if gem not in bundle" do
38
38
  bundle "show missing"
39
- out.should =~ /could not find gem 'missing'/i
39
+ expect(out).to match(/could not find gem 'missing'/i)
40
40
  end
41
41
 
42
42
  it "prints path of all gems in bundle" do
43
43
  bundle "show --paths"
44
- out.should include(default_bundle_path('gems', 'rake-10.0.2').to_s)
45
- out.should include(default_bundle_path('gems', 'rails-2.3.2').to_s)
44
+ expect(out).to include(default_bundle_path('gems', 'rake-10.0.2').to_s)
45
+ expect(out).to include(default_bundle_path('gems', 'rails-2.3.2').to_s)
46
46
  end
47
47
  end
48
48
 
@@ -58,7 +58,7 @@ describe "bundle show with a git repo" do
58
58
  should_be_installed "foo 1.0"
59
59
 
60
60
  bundle :show
61
- out.should include("foo (1.0 #{@git.ref_for('master', 6)}")
61
+ expect(out).to include("foo (1.0 #{@git.ref_for('master', 6)}")
62
62
  end
63
63
 
64
64
  it "prints out branch names other than master" do
@@ -73,7 +73,7 @@ describe "bundle show with a git repo" do
73
73
  should_be_installed "foo 1.0.omg"
74
74
 
75
75
  bundle :show
76
- out.should include("foo (1.0 #{@git.ref_for('omg', 6)}")
76
+ expect(out).to include("foo (1.0 #{@git.ref_for('omg', 6)}")
77
77
  end
78
78
 
79
79
  it "doesn't print the branch when tied to a ref" do
@@ -83,6 +83,6 @@ describe "bundle show with a git repo" do
83
83
  G
84
84
 
85
85
  bundle :show
86
- out.should include("foo (1.0 #{sha[0..6]})")
86
+ expect(out).to include("foo (1.0 #{sha[0..6]})")
87
87
  end
88
88
  end
@@ -47,13 +47,13 @@ describe "The library itself" do
47
47
  error_messages << check_for_extra_spaces(filename)
48
48
  end
49
49
  end
50
- error_messages.compact.should be_well_formed
50
+ expect(error_messages.compact).to be_well_formed
51
51
  end
52
52
 
53
53
  it "can still be built" do
54
54
  Dir.chdir(root) do
55
55
  `gem build bundler.gemspec`
56
- $?.should eq(0)
56
+ expect($?).to eq(0)
57
57
 
58
58
  # clean up the .gem generated
59
59
  system("rm bundler-#{Bundler::VERSION}.gem")
@@ -0,0 +1,61 @@
1
+ require "spec_helper"
2
+
3
+ describe "gemcutter's dependency API", :realworld => true do
4
+ def wait_for_server(port, seconds = 15)
5
+ tries = 0
6
+ TCPSocket.new("127.0.0.1", port)
7
+ rescue => e
8
+ raise(e) if tries > (seconds * 2)
9
+ tries += 1
10
+ sleep 0.5
11
+ retry
12
+ end
13
+
14
+ context "when Gemcutter API takes too long to respond" do
15
+ before do
16
+ # need to hack, so we can require rack
17
+ old_gem_home = ENV['GEM_HOME']
18
+ ENV['GEM_HOME'] = Spec::Path.base_system_gems.to_s
19
+ require 'rack'
20
+ ENV['GEM_HOME'] = old_gem_home
21
+
22
+ port = 21453
23
+ port += 1 while TCPSocket.new("127.0.0.1", port) rescue false
24
+ @server_uri = "http://127.0.0.1:#{port}"
25
+
26
+ require File.expand_path('../../support/artifice/endpoint_timeout', __FILE__)
27
+ require 'thread'
28
+ @t = Thread.new {
29
+ server = Rack::Server.start(:app => EndpointTimeout,
30
+ :Host => '0.0.0.0',
31
+ :Port => port,
32
+ :server => 'webrick',
33
+ :AccessLog => [])
34
+ server.start
35
+ }
36
+ @t.run
37
+
38
+ wait_for_server(port)
39
+ end
40
+
41
+ after do
42
+ @t.kill
43
+ end
44
+
45
+ it "times out and falls back on the modern index" do
46
+ gemfile <<-G
47
+ source "#{@server_uri}"
48
+ gem "rack"
49
+
50
+ old_v, $VERBOSE = $VERBOSE, nil
51
+ Bundler::Fetcher::API_TIMEOUT = 1
52
+ $VERBOSE = old_v
53
+ G
54
+
55
+ bundle :install
56
+ expect(out).to include("\nFetching full source index from #{@server_uri}")
57
+ should_be_installed "rack 1.0.0"
58
+ end
59
+ end
60
+
61
+ end
@@ -7,23 +7,23 @@ describe "real world edgecases", :realworld => true do
7
7
  source :rubygems
8
8
  gem "linecache", "0.46"
9
9
  G
10
- err.should eq("")
10
+ expect(err).to eq("")
11
11
  end
12
12
 
13
13
  # https://github.com/carlhuda/bundler/issues/1202
14
- it "bundle cache works with rubygems 1.3.7 and pre gems", :ruby => "1.8" do
14
+ it "bundle cache works with rubygems 1.3.7 and pre gems" do
15
15
  install_gemfile <<-G
16
16
  source :rubygems
17
17
  gem "rack", "1.3.0.beta2"
18
18
  gem "will_paginate", "3.0.pre2"
19
19
  G
20
20
  bundle :cache
21
- out.should_not include("Removing outdated .gem files from vendor/cache")
21
+ expect(out).not_to include("Removing outdated .gem files from vendor/cache")
22
22
  end
23
23
 
24
24
  # https://github.com/carlhuda/bundler/issues/1486
25
25
  # this is a hash collision that only manifests on 1.8.7
26
- it "finds the correct child versions", :ruby => "1.8" do
26
+ it "finds the correct child versions" do
27
27
  install_gemfile <<-G
28
28
  source :rubygems
29
29
 
@@ -32,7 +32,7 @@ describe "real world edgecases", :realworld => true do
32
32
  gem 'activerecord', '~> 3.0'
33
33
  gem 'builder', '~> 2.1.2'
34
34
  G
35
- out.should include("activemodel (3.0.5)")
35
+ expect(out).to include("activemodel (3.0.5)")
36
36
  end
37
37
 
38
38
  # https://github.com/carlhuda/bundler/issues/1500
@@ -45,8 +45,8 @@ describe "real world edgecases", :realworld => true do
45
45
  G
46
46
 
47
47
  bundle "install --path vendor/bundle", :expect_err => true
48
- err.should_not include("Could not find rake")
49
- err.should be_empty
48
+ expect(err).not_to include("Could not find rake")
49
+ expect(err).to be_empty
50
50
  end
51
51
 
52
52
  it "checks out git repos when the lockfile is corrupted" do
@@ -172,6 +172,6 @@ describe "real world edgecases", :realworld => true do
172
172
  L
173
173
 
174
174
  bundle :install, :exitstatus => true
175
- exitstatus.should == 0
175
+ expect(exitstatus).to eq(0)
176
176
  end
177
177
  end
@@ -16,34 +16,34 @@ describe "Running bin/* commands" do
16
16
  end
17
17
 
18
18
  gembin "rackup"
19
- out.should == "1.0.0"
19
+ expect(out).to eq("1.0.0")
20
20
  end
21
21
 
22
22
  it "allows the location of the gem stubs to be specified" do
23
23
  bundle "install --binstubs gbin"
24
24
 
25
- bundled_app("bin").should_not exist
26
- bundled_app("gbin/rackup").should exist
25
+ expect(bundled_app("bin")).not_to exist
26
+ expect(bundled_app("gbin/rackup")).to exist
27
27
 
28
28
  gembin bundled_app("gbin/rackup")
29
- out.should == "1.0.0"
29
+ expect(out).to eq("1.0.0")
30
30
  end
31
31
 
32
32
  it "allows absolute paths as a specification of where to install bin stubs" do
33
33
  bundle "install --binstubs #{tmp}/bin"
34
34
 
35
35
  gembin tmp("bin/rackup")
36
- out.should == "1.0.0"
36
+ expect(out).to eq("1.0.0")
37
37
  end
38
38
 
39
39
  it "uses the default ruby install name when shebang is not specified" do
40
40
  bundle "install --binstubs"
41
- File.open("bin/rackup").gets.should == "#!/usr/bin/env #{RbConfig::CONFIG['ruby_install_name']}\n"
41
+ expect(File.open("bin/rackup").gets).to eq("#!/usr/bin/env #{RbConfig::CONFIG['ruby_install_name']}\n")
42
42
  end
43
43
 
44
44
  it "allows the name of the shebang executable to be specified" do
45
45
  bundle "install --binstubs --shebang ruby-foo"
46
- File.open("bin/rackup").gets.should == "#!/usr/bin/env ruby-foo\n"
46
+ expect(File.open("bin/rackup").gets).to eq("#!/usr/bin/env ruby-foo\n")
47
47
  end
48
48
 
49
49
  it "runs the bundled command when out of the bundle" do
@@ -55,7 +55,7 @@ describe "Running bin/* commands" do
55
55
 
56
56
  Dir.chdir(tmp) do
57
57
  gembin "rackup"
58
- out.should == "1.0.0"
58
+ expect(out).to eq("1.0.0")
59
59
  end
60
60
  end
61
61
 
@@ -75,7 +75,7 @@ describe "Running bin/* commands" do
75
75
  end
76
76
 
77
77
  gembin "rackup"
78
- out.should == '1.0'
78
+ expect(out).to eq('1.0')
79
79
  end
80
80
 
81
81
  it "don't bundle da bundla" do
@@ -90,13 +90,13 @@ describe "Running bin/* commands" do
90
90
 
91
91
  bundle "install --binstubs"
92
92
 
93
- bundled_app("bin/bundle").should_not exist
93
+ expect(bundled_app("bin/bundle")).not_to exist
94
94
  end
95
95
 
96
96
  it "does not generate bin stubs if the option was not specified" do
97
97
  bundle "install"
98
98
 
99
- bundled_app("bin/rackup").should_not exist
99
+ expect(bundled_app("bin/rackup")).not_to exist
100
100
  end
101
101
 
102
102
  it "remembers that the option was specified" do
@@ -115,6 +115,6 @@ describe "Running bin/* commands" do
115
115
 
116
116
  bundle "install"
117
117
 
118
- bundled_app("bin/rackup").should exist
118
+ expect(bundled_app("bin/rackup")).to exist
119
119
  end
120
- end
120
+ end
@@ -21,34 +21,34 @@ describe "Bundler.load" do
21
21
  end
22
22
 
23
23
  it "provides a list of the env dependencies" do
24
- Bundler.load.dependencies.should have_dep("rack", ">= 0")
24
+ expect(Bundler.load.dependencies).to have_dep("rack", ">= 0")
25
25
  end
26
26
 
27
27
  it "provides a list of the resolved gems" do
28
- Bundler.load.gems.should have_gem("rack-1.0.0", "bundler-#{Bundler::VERSION}")
28
+ expect(Bundler.load.gems).to have_gem("rack-1.0.0", "bundler-#{Bundler::VERSION}")
29
29
  end
30
30
 
31
31
  it "ignores blank BUNDLE_GEMFILEs" do
32
- lambda {
32
+ expect {
33
33
  ENV['BUNDLE_GEMFILE'] = ""
34
34
  Bundler.load
35
- }.should_not raise_error(Bundler::GemfileNotFound)
35
+ }.not_to raise_error(Bundler::GemfileNotFound)
36
36
  end
37
37
 
38
38
  end
39
39
 
40
40
  describe "without a gemfile" do
41
41
  it "raises an exception if the default gemfile is not found" do
42
- lambda {
42
+ expect {
43
43
  Bundler.load
44
- }.should raise_error(Bundler::GemfileNotFound, /could not locate gemfile/i)
44
+ }.to raise_error(Bundler::GemfileNotFound, /could not locate gemfile/i)
45
45
  end
46
46
 
47
47
  it "raises an exception if a specified gemfile is not found" do
48
- lambda {
48
+ expect {
49
49
  ENV['BUNDLE_GEMFILE'] = "omg.rb"
50
50
  Bundler.load
51
- }.should raise_error(Bundler::GemfileNotFound, /omg\.rb/)
51
+ }.to raise_error(Bundler::GemfileNotFound, /omg\.rb/)
52
52
  end
53
53
 
54
54
  it "does not find a Gemfile above the testing directory" do
@@ -58,7 +58,7 @@ describe "Bundler.load" do
58
58
  @remove_bundler_gemfile = true
59
59
  end
60
60
  begin
61
- lambda { Bundler.load }.should raise_error(Bundler::GemfileNotFound)
61
+ expect { Bundler.load }.to raise_error(Bundler::GemfileNotFound)
62
62
  ensure
63
63
  bundler_gemfile.rmtree if @remove_bundler_gemfile
64
64
  end
@@ -86,7 +86,7 @@ describe "Bundler.load" do
86
86
  end
87
87
  RUBY
88
88
 
89
- out.split("\n").should == ["1.0.0", "no activesupport"]
89
+ expect(out.split("\n")).to eq(["1.0.0", "no activesupport"])
90
90
  end
91
91
  end
92
92
 
@@ -98,8 +98,8 @@ describe "Bundler.load" do
98
98
  G
99
99
 
100
100
  Bundler.load.specs.each do |spec|
101
- spec.to_yaml.should_not =~ /^\s+source:/
102
- spec.to_yaml.should_not =~ /^\s+groups:/
101
+ expect(spec.to_yaml).not_to match(/^\s+source:/)
102
+ expect(spec.to_yaml).not_to match(/^\s+groups:/)
103
103
  end
104
104
  end
105
105
  end
@@ -29,7 +29,7 @@ describe "Bundler.setup with multi platform stuff" do
29
29
  end
30
30
  R
31
31
 
32
- out.should == "WIN"
32
+ expect(out).to eq("WIN")
33
33
  end
34
34
 
35
35
  it "will resolve correctly on the current platform when the lockfile was targetted for a different one" do
@@ -48,32 +48,32 @@ describe "Bundler.require" do
48
48
  it "requires the gems" do
49
49
  # default group
50
50
  run "Bundler.require"
51
- out.should eq("two")
51
+ expect(out).to eq("two")
52
52
 
53
53
  # specific group
54
54
  run "Bundler.require(:bar)"
55
- out.should eq("baz\nqux")
55
+ expect(out).to eq("baz\nqux")
56
56
 
57
57
  # default and specific group
58
58
  run "Bundler.require(:default, :bar)"
59
- out.should eq("baz\nqux\ntwo")
59
+ expect(out).to eq("baz\nqux\ntwo")
60
60
 
61
61
  # specific group given as a string
62
62
  run "Bundler.require('bar')"
63
- out.should eq("baz\nqux")
63
+ expect(out).to eq("baz\nqux")
64
64
 
65
65
  # specific group declared as a string
66
66
  run "Bundler.require(:string)"
67
- out.should eq("six")
67
+ expect(out).to eq("six")
68
68
 
69
69
  # required in resolver order instead of gemfile order
70
70
  run("Bundler.require(:not)")
71
- out.split("\n").sort.should == ['seven', 'three']
71
+ expect(out.split("\n").sort).to eq(['seven', 'three'])
72
72
  end
73
73
 
74
74
  it "allows requiring gems with non standard names explicitly" do
75
75
  run "Bundler.require ; require 'mofive'"
76
- out.should == "two\nfive"
76
+ expect(out).to eq("two\nfive")
77
77
  end
78
78
 
79
79
  it "raises an exception if a require is specified but the file does not exist" do
@@ -86,7 +86,7 @@ describe "Bundler.require" do
86
86
  Bundler.require
87
87
  R
88
88
 
89
- err.should == "ZOMG LOAD ERROR"
89
+ expect(err).to eq("ZOMG LOAD ERROR")
90
90
  end
91
91
 
92
92
  describe "with namespaced gems" do
@@ -104,7 +104,7 @@ describe "Bundler.require" do
104
104
  G
105
105
 
106
106
  run "Bundler.require"
107
- out.should eq("jquery/rails")
107
+ expect(out).to eq("jquery/rails")
108
108
  end
109
109
 
110
110
  it "silently passes if the require fails" do
@@ -122,7 +122,7 @@ describe "Bundler.require" do
122
122
  RUBY
123
123
  ruby(cmd, :expect_err => true)
124
124
 
125
- err.should be_empty
125
+ expect(err).to be_empty
126
126
  end
127
127
 
128
128
  it "does not mangle explictly given requires" do
@@ -134,7 +134,7 @@ describe "Bundler.require" do
134
134
  load_error_run <<-R, 'jquery-rails'
135
135
  Bundler.require
136
136
  R
137
- err.should == "ZOMG LOAD ERROR"
137
+ expect(err).to eq("ZOMG LOAD ERROR")
138
138
  end
139
139
 
140
140
  it "handles the case where regex fails" do
@@ -156,20 +156,20 @@ describe "Bundler.require" do
156
156
  RUBY
157
157
  run(cmd, :expect_err => true)
158
158
 
159
- err.should == "ZOMG LOAD ERROR"
159
+ expect(err).to eq("ZOMG LOAD ERROR")
160
160
  end
161
161
  end
162
162
 
163
163
  describe "using bundle exec" do
164
164
  it "requires the locked gems" do
165
165
  bundle "exec ruby -e 'Bundler.require'"
166
- out.should eq("two")
166
+ expect(out).to eq("two")
167
167
 
168
168
  bundle "exec ruby -e 'Bundler.require(:bar)'"
169
- out.should eq("baz\nqux")
169
+ expect(out).to eq("baz\nqux")
170
170
 
171
171
  bundle "exec ruby -e 'Bundler.require(:default, :bar)'"
172
- out.should == "baz\nqux\ntwo"
172
+ expect(out).to eq("baz\nqux\ntwo")
173
173
  end
174
174
  end
175
175
 
@@ -206,7 +206,7 @@ describe "Bundler.require" do
206
206
  G
207
207
 
208
208
  run "Bundler.require"
209
- out.should eq("two\nmodule_two\none")
209
+ expect(out).to eq("two\nmodule_two\none")
210
210
  end
211
211
 
212
212
  describe "a gem with different requires for different envs" do
@@ -224,17 +224,17 @@ describe "Bundler.require" do
224
224
 
225
225
  it "requires both with Bundler.require(both)" do
226
226
  run "Bundler.require(:one, :two)"
227
- out.should == "ONE\nTWO"
227
+ expect(out).to eq("ONE\nTWO")
228
228
  end
229
229
 
230
230
  it "requires one with Bundler.require(:one)" do
231
231
  run "Bundler.require(:one)"
232
- out.should == "ONE"
232
+ expect(out).to eq("ONE")
233
233
  end
234
234
 
235
235
  it "requires :two with Bundler.require(:two)" do
236
236
  run "Bundler.require(:two)"
237
- out.should == "TWO"
237
+ expect(out).to eq("TWO")
238
238
  end
239
239
  end
240
240
 
@@ -246,7 +246,7 @@ describe "Bundler.require" do
246
246
  G
247
247
 
248
248
  run "Bundler.require"
249
- out.should eq("two_not_loaded\none\ntwo")
249
+ expect(out).to eq("two_not_loaded\none\ntwo")
250
250
  end
251
251
 
252
252
  describe "with busted gems" do
@@ -262,7 +262,7 @@ describe "Bundler.require" do
262
262
  load_error_run <<-R, 'no_such_file_omg'
263
263
  Bundler.require
264
264
  R
265
- err.should == 'ZOMG LOAD ERROR'
265
+ expect(err).to eq('ZOMG LOAD ERROR')
266
266
  end
267
267
  end
268
268
  end
@@ -281,7 +281,7 @@ describe "Bundler.require with platform specific dependencies" do
281
281
  G
282
282
 
283
283
  run "Bundler.require", :expect_err => true
284
- err.should be_empty
284
+ expect(err).to be_empty
285
285
  end
286
286
 
287
287
  it "requires gems pinned to multiple platforms, including the current one" do
@@ -295,7 +295,7 @@ describe "Bundler.require with platform specific dependencies" do
295
295
 
296
296
  run "Bundler.require; puts RACK", :expect_err => true
297
297
 
298
- out.should eq("1.0.0")
299
- err.should be_empty
298
+ expect(out).to eq("1.0.0")
299
+ expect(err).to be_empty
300
300
  end
301
301
  end