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
@@ -3,12 +3,12 @@ require "spec_helper"
3
3
  describe "git base name" do
4
4
  it "base_name should strip private repo uris" do
5
5
  source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git")
6
- source.send(:base_name).should == "bundler"
6
+ expect(source.send(:base_name)).to eq("bundler")
7
7
  end
8
8
 
9
9
  it "base_name should strip network share paths" do
10
10
  source = Bundler::Source::Git.new("uri" => "//MachineName/ShareFolder")
11
- source.send(:base_name).should == "ShareFolder"
11
+ expect(source.send(:base_name)).to eq("ShareFolder")
12
12
  end
13
13
  end
14
14
 
@@ -23,9 +23,9 @@ end
23
23
  G
24
24
 
25
25
  bundle "#{cmd} --all"
26
- bundled_app("vendor/cache/foo-1.0-#{ref}").should exist
27
- bundled_app("vendor/cache/foo-1.0-#{ref}/.git").should_not exist
28
- bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache").should be_file
26
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
27
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
28
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache")).to be_file
29
29
 
30
30
  FileUtils.rm_rf lib_path("foo-1.0")
31
31
  should_be_installed "foo 1.0"
@@ -42,8 +42,8 @@ end
42
42
  bundle "install --path vendor/bundle"
43
43
  bundle "#{cmd} --all"
44
44
 
45
- bundled_app("vendor/cache/foo-1.0-#{ref}").should exist
46
- bundled_app("vendor/cache/foo-1.0-#{ref}/.git").should_not exist
45
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
46
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
47
47
 
48
48
  FileUtils.rm_rf lib_path("foo-1.0")
49
49
  should_be_installed "foo 1.0"
@@ -59,7 +59,7 @@ end
59
59
  bundle "#{cmd} --all"
60
60
  bundle "#{cmd} --all"
61
61
 
62
- err.should == ""
62
+ expect(err).to eq("")
63
63
  FileUtils.rm_rf lib_path("foo-1.0")
64
64
  should_be_installed "foo 1.0"
65
65
  end
@@ -79,17 +79,17 @@ end
79
79
  end
80
80
 
81
81
  ref = git.ref_for("master", 11)
82
- ref.should_not == old_ref
82
+ expect(ref).not_to eq(old_ref)
83
83
 
84
84
  bundle "update"
85
85
  bundle "#{cmd} --all"
86
86
 
87
- bundled_app("vendor/cache/foo-1.0-#{ref}").should exist
88
- bundled_app("vendor/cache/foo-1.0-#{old_ref}").should_not exist
87
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
88
+ expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
89
89
 
90
90
  FileUtils.rm_rf lib_path("foo-1.0")
91
91
  run "require 'foo'"
92
- out.should == "CACHE"
92
+ expect(out).to eq("CACHE")
93
93
  end
94
94
 
95
95
  it "uses the local repository to generate the cache" do
@@ -104,7 +104,7 @@ end
104
104
  bundle "install"
105
105
  bundle "#{cmd} --all"
106
106
 
107
- bundled_app("vendor/cache/foo-invalid-#{ref}").should exist
107
+ expect(bundled_app("vendor/cache/foo-invalid-#{ref}")).to exist
108
108
 
109
109
  # Updating the local still uses the local.
110
110
  update_git "foo" do |s|
@@ -112,7 +112,7 @@ end
112
112
  end
113
113
 
114
114
  run "require 'foo'"
115
- out.should == "LOCAL"
115
+ expect(out).to eq("LOCAL")
116
116
  end
117
117
 
118
118
  it "copies repository to vendor cache, including submodules" do
@@ -136,14 +136,13 @@ end
136
136
  ref = git.ref_for("master", 11)
137
137
  bundle "#{cmd} --all"
138
138
 
139
- bundled_app("vendor/cache/has_submodule-1.0-#{ref}").should exist
140
- bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0").should exist
139
+ expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}")).to exist
140
+ expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0")).to exist
141
141
  should_be_installed "has_submodule 1.0"
142
142
  end
143
143
 
144
144
  it "displays warning message when detecting git repo in Gemfile" do
145
- git = build_git "foo"
146
- ref = git.ref_for("master", 11)
145
+ build_git "foo"
147
146
 
148
147
  install_gemfile <<-G
149
148
  gem "foo", :git => '#{lib_path("foo-1.0")}'
@@ -151,12 +150,11 @@ end
151
150
 
152
151
  bundle "#{cmd}"
153
152
 
154
- out.should include("Your Gemfile contains path and git dependencies.")
153
+ expect(out).to include("Your Gemfile contains path and git dependencies.")
155
154
  end
156
155
 
157
156
  it "does not display warning message if cache_all is set in bundle config" do
158
- git = build_git "foo"
159
- ref = git.ref_for("master", 11)
157
+ build_git "foo"
160
158
 
161
159
  install_gemfile <<-G
162
160
  gem "foo", :git => '#{lib_path("foo-1.0")}'
@@ -165,7 +163,7 @@ end
165
163
  bundle "#{cmd} --all"
166
164
  bundle "#{cmd}"
167
165
 
168
- out.should_not include("Your Gemfile contains path and git dependencies.")
166
+ expect(out).not_to include("Your Gemfile contains path and git dependencies.")
169
167
  end
170
168
  end
171
- end
169
+ end
@@ -10,7 +10,7 @@ require "spec_helper"
10
10
  G
11
11
 
12
12
  bundle "#{cmd} --all"
13
- bundled_app("vendor/cache/foo-1.0").should_not exist
13
+ expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
14
14
  should_be_installed "foo 1.0"
15
15
  end
16
16
 
@@ -22,8 +22,8 @@ require "spec_helper"
22
22
  G
23
23
 
24
24
  bundle "#{cmd} --all"
25
- bundled_app("vendor/cache/foo-1.0").should exist
26
- bundled_app("vendor/cache/foo-1.0/.bundlecache").should be_file
25
+ expect(bundled_app("vendor/cache/foo-1.0")).to exist
26
+ expect(bundled_app("vendor/cache/foo-1.0/.bundlecache")).to be_file
27
27
 
28
28
  FileUtils.rm_rf lib_path("foo-1.0")
29
29
  should_be_installed "foo 1.0"
@@ -44,11 +44,11 @@ require "spec_helper"
44
44
 
45
45
  bundle "#{cmd} --all"
46
46
 
47
- bundled_app("vendor/cache/foo-1.0").should exist
47
+ expect(bundled_app("vendor/cache/foo-1.0")).to exist
48
48
  FileUtils.rm_rf lib_path("foo-1.0")
49
49
 
50
50
  run "require 'foo'"
51
- out.should == "CACHE"
51
+ expect(out).to eq("CACHE")
52
52
  end
53
53
 
54
54
  it "removes stale entries cache" do
@@ -65,7 +65,7 @@ require "spec_helper"
65
65
  G
66
66
 
67
67
  bundle "#{cmd} --all"
68
- bundled_app("vendor/cache/bar-1.0").should_not exist
68
+ expect(bundled_app("vendor/cache/bar-1.0")).not_to exist
69
69
  end
70
70
 
71
71
  it "raises a warning without --all" do
@@ -76,8 +76,8 @@ require "spec_helper"
76
76
  G
77
77
 
78
78
  bundle cmd
79
- out.should =~ /please pass the \-\-all flag/
80
- bundled_app("vendor/cache/foo-1.0").should_not exist
79
+ expect(out).to match(/please pass the \-\-all flag/)
80
+ expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
81
81
  end
82
82
 
83
83
  it "stores the given flag" do
@@ -96,7 +96,7 @@ require "spec_helper"
96
96
  G
97
97
 
98
98
  bundle cmd
99
- bundled_app("vendor/cache/bar-1.0").should exist
99
+ expect(bundled_app("vendor/cache/bar-1.0")).to exist
100
100
  end
101
101
 
102
102
  it "can rewind chosen configuration" do
@@ -115,7 +115,7 @@ require "spec_helper"
115
115
  G
116
116
 
117
117
  bundle "#{cmd} --no-all"
118
- bundled_app("vendor/cache/baz-1.0").should_not exist
118
+ expect(bundled_app("vendor/cache/baz-1.0")).not_to exist
119
119
  end
120
120
  end
121
- end
121
+ end
@@ -42,16 +42,16 @@ describe "bundle cache with multiple platforms" do
42
42
  it "ensures that bundle install does not delete gems for other platforms" do
43
43
  bundle "install"
44
44
 
45
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
46
- bundled_app("vendor/cache/activesupport-2.3.5.gem").should exist
47
- bundled_app("vendor/cache/activerecord-2.3.2.gem").should exist
45
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
46
+ expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
47
+ expect(bundled_app("vendor/cache/activerecord-2.3.2.gem")).to exist
48
48
  end
49
49
 
50
50
  it "ensures that bundle update does not delete gems for other platforms" do
51
51
  bundle "update"
52
52
 
53
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
54
- bundled_app("vendor/cache/activesupport-2.3.5.gem").should exist
55
- bundled_app("vendor/cache/activerecord-2.3.2.gem").should exist
53
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
54
+ expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
55
+ expect(bundled_app("vendor/cache/activerecord-2.3.2.gem")).to exist
56
56
  end
57
57
  end
@@ -10,18 +10,18 @@ describe "install with --deployment or --frozen" do
10
10
 
11
11
  it "fails without a lockfile and says that --deployment requires a lock" do
12
12
  bundle "install --deployment"
13
- out.should include("The --deployment flag requires a Gemfile.lock")
13
+ expect(out).to include("The --deployment flag requires a Gemfile.lock")
14
14
  end
15
15
 
16
16
  it "fails without a lockfile and says that --frozen requires a lock" do
17
17
  bundle "install --frozen"
18
- out.should include("The --frozen flag requires a Gemfile.lock")
18
+ expect(out).to include("The --frozen flag requires a Gemfile.lock")
19
19
  end
20
20
 
21
21
  it "works after you try to deploy without a lock" do
22
22
  bundle "install --deployment"
23
23
  bundle :install, :exitstatus => true
24
- exitstatus.should eq(0)
24
+ expect(exitstatus).to eq(0)
25
25
  should_be_installed "rack 1.0"
26
26
  end
27
27
 
@@ -43,14 +43,14 @@ describe "install with --deployment or --frozen" do
43
43
  G
44
44
  bundle :install
45
45
  bundle "install --deployment --without test", :exitstatus => true
46
- exitstatus.should == 0
46
+ expect(exitstatus).to eq(0)
47
47
  end
48
48
 
49
49
  it "works when you bundle exec bundle" do
50
50
  bundle :install
51
51
  bundle "install --deployment"
52
52
  bundle "exec bundle check", :exitstatus => true
53
- exitstatus.should == 0
53
+ expect(exitstatus).to eq(0)
54
54
  end
55
55
 
56
56
  it "works when using path gems from the same path and the version is specified" do
@@ -64,7 +64,7 @@ describe "install with --deployment or --frozen" do
64
64
  bundle :install
65
65
  bundle "install --deployment", :exitstatus => true
66
66
 
67
- exitstatus.should == 0
67
+ expect(exitstatus).to eq(0)
68
68
  end
69
69
 
70
70
  describe "with an existing lockfile" do
@@ -74,12 +74,12 @@ describe "install with --deployment or --frozen" do
74
74
 
75
75
  it "works with the --deployment flag if you didn't change anything" do
76
76
  bundle "install --deployment", :exitstatus => true
77
- exitstatus.should == 0
77
+ expect(exitstatus).to eq(0)
78
78
  end
79
79
 
80
80
  it "works with the --frozen flag if you didn't change anything" do
81
81
  bundle "install --frozen", :exitstatus => true
82
- exitstatus.should == 0
82
+ expect(exitstatus).to eq(0)
83
83
  end
84
84
 
85
85
  it "explodes with the --deployment flag if you make a change and don't check in the lockfile" do
@@ -90,11 +90,11 @@ describe "install with --deployment or --frozen" do
90
90
  G
91
91
 
92
92
  bundle "install --deployment"
93
- out.should include("deployment mode")
94
- out.should include("You have added to the Gemfile")
95
- out.should include("* rack-obama")
96
- out.should_not include("You have deleted from the Gemfile")
97
- out.should_not include("You have changed in the Gemfile")
93
+ expect(out).to include("deployment mode")
94
+ expect(out).to include("You have added to the Gemfile")
95
+ expect(out).to include("* rack-obama")
96
+ expect(out).not_to include("You have deleted from the Gemfile")
97
+ expect(out).not_to include("You have changed in the Gemfile")
98
98
  end
99
99
 
100
100
  it "can have --frozen set via an environment variable" do
@@ -106,11 +106,11 @@ describe "install with --deployment or --frozen" do
106
106
 
107
107
  ENV['BUNDLE_FROZEN'] = '1'
108
108
  bundle "install"
109
- out.should include("deployment mode")
110
- out.should include("You have added to the Gemfile")
111
- out.should include("* rack-obama")
112
- out.should_not include("You have deleted from the Gemfile")
113
- out.should_not include("You have changed in the Gemfile")
109
+ expect(out).to include("deployment mode")
110
+ expect(out).to include("You have added to the Gemfile")
111
+ expect(out).to include("* rack-obama")
112
+ expect(out).not_to include("You have deleted from the Gemfile")
113
+ expect(out).not_to include("You have changed in the Gemfile")
114
114
  end
115
115
 
116
116
  it "explodes with the --frozen flag if you make a change and don't check in the lockfile" do
@@ -121,11 +121,11 @@ describe "install with --deployment or --frozen" do
121
121
  G
122
122
 
123
123
  bundle "install --frozen"
124
- out.should include("deployment mode")
125
- out.should include("You have added to the Gemfile")
126
- out.should include("* rack-obama")
127
- out.should_not include("You have deleted from the Gemfile")
128
- out.should_not include("You have changed in the Gemfile")
124
+ expect(out).to include("deployment mode")
125
+ expect(out).to include("You have added to the Gemfile")
126
+ expect(out).to include("* rack-obama")
127
+ expect(out).not_to include("You have deleted from the Gemfile")
128
+ expect(out).not_to include("You have changed in the Gemfile")
129
129
  end
130
130
 
131
131
  it "explodes if you remove a gem and don't check in the lockfile" do
@@ -135,10 +135,10 @@ describe "install with --deployment or --frozen" do
135
135
  G
136
136
 
137
137
  bundle "install --deployment"
138
- out.should include("deployment mode")
139
- out.should include("You have added to the Gemfile:\n* activesupport\n\n")
140
- out.should include("You have deleted from the Gemfile:\n* rack")
141
- out.should_not include("You have changed in the Gemfile")
138
+ expect(out).to include("deployment mode")
139
+ expect(out).to include("You have added to the Gemfile:\n* activesupport\n\n")
140
+ expect(out).to include("You have deleted from the Gemfile:\n* rack")
141
+ expect(out).not_to include("You have changed in the Gemfile")
142
142
  end
143
143
 
144
144
  it "explodes if you add a source" do
@@ -148,9 +148,9 @@ describe "install with --deployment or --frozen" do
148
148
  G
149
149
 
150
150
  bundle "install --deployment"
151
- out.should include("deployment mode")
152
- out.should include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
153
- out.should_not include("You have changed in the Gemfile")
151
+ expect(out).to include("deployment mode")
152
+ expect(out).to include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
153
+ expect(out).not_to include("You have changed in the Gemfile")
154
154
  end
155
155
 
156
156
  it "explodes if you unpin a source" do
@@ -167,10 +167,10 @@ describe "install with --deployment or --frozen" do
167
167
  G
168
168
 
169
169
  bundle "install --deployment"
170
- out.should include("deployment mode")
171
- out.should include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master)")
172
- out.should_not include("You have added to the Gemfile")
173
- out.should_not include("You have changed in the Gemfile")
170
+ expect(out).to include("deployment mode")
171
+ expect(out).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master)")
172
+ expect(out).not_to include("You have added to the Gemfile")
173
+ expect(out).not_to include("You have changed in the Gemfile")
174
174
  end
175
175
 
176
176
  it "explodes if you unpin a source, leaving it pinned somewhere else" do
@@ -190,10 +190,10 @@ describe "install with --deployment or --frozen" do
190
190
  G
191
191
 
192
192
  bundle "install --deployment"
193
- out.should include("deployment mode")
194
- out.should include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`")
195
- out.should_not include("You have added to the Gemfile")
196
- out.should_not include("You have deleted from the Gemfile")
193
+ expect(out).to include("deployment mode")
194
+ expect(out).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`")
195
+ expect(out).not_to include("You have added to the Gemfile")
196
+ expect(out).not_to include("You have deleted from the Gemfile")
197
197
  end
198
198
 
199
199
  it "remembers that the bundle is frozen at runtime" do
@@ -40,9 +40,9 @@ describe "installing a gem with C extensions" do
40
40
  bundle "config build.c_extension --with-c_extension=hello"
41
41
  bundle "install"
42
42
 
43
- out.should_not include("extconf.rb failed")
43
+ expect(out).not_to include("extconf.rb failed")
44
44
 
45
45
  run "Bundler.require; puts CExtension.new.its_true"
46
- out.should == "true"
46
+ expect(out).to eq("true")
47
47
  end
48
48
  end
@@ -10,7 +10,7 @@ describe "gemcutter's dependency API" do
10
10
  G
11
11
 
12
12
  bundle :install, :artifice => "endpoint"
13
- out.should include("Fetching gem metadata from #{source_uri}")
13
+ expect(out).to include("Fetching gem metadata from #{source_uri}")
14
14
  should_be_installed "rack 1.0.0"
15
15
  end
16
16
 
@@ -21,7 +21,7 @@ describe "gemcutter's dependency API" do
21
21
  G
22
22
 
23
23
  bundle :install, :artifice => "endpoint"
24
- out.should include("Could not find gem ' sinatra")
24
+ expect(out).to include("Could not find gem ' sinatra")
25
25
  end
26
26
 
27
27
  it "should handle nested dependencies" do
@@ -31,7 +31,7 @@ describe "gemcutter's dependency API" do
31
31
  G
32
32
 
33
33
  bundle :install, :artifice => "endpoint"
34
- out.should include("Fetching gem metadata from #{source_uri}/...")
34
+ expect(out).to include("Fetching gem metadata from #{source_uri}/...")
35
35
  should_be_installed(
36
36
  "rails 2.3.2",
37
37
  "actionpack 2.3.2",
@@ -59,7 +59,7 @@ describe "gemcutter's dependency API" do
59
59
  bundle :install, :artifice => "endpoint"
60
60
 
61
61
  bundle "install --deployment", :artifice => "endpoint"
62
- out.should include("Fetching gem metadata from #{source_uri}")
62
+ expect(out).to include("Fetching gem metadata from #{source_uri}")
63
63
  should_be_installed "rack 1.0.0"
64
64
  end
65
65
 
@@ -108,7 +108,7 @@ describe "gemcutter's dependency API" do
108
108
  G
109
109
 
110
110
  bundle :install, :fakeweb => "windows"
111
- out.should include("\nFetching full source index from #{source_uri}")
111
+ expect(out).to include("\nFetching full source index from #{source_uri}")
112
112
  should_be_installed "rcov 1.0.0"
113
113
  end
114
114
 
@@ -124,7 +124,7 @@ describe "gemcutter's dependency API" do
124
124
  gem "rails"
125
125
  G
126
126
  bundle :install, :artifice => "endpoint_fallback"
127
- out.should include("\nFetching full source index from #{source_uri}")
127
+ expect(out).to include("\nFetching full source index from #{source_uri}")
128
128
 
129
129
  should_be_installed(
130
130
  "activesupport 2.3.2",
@@ -144,7 +144,7 @@ describe "gemcutter's dependency API" do
144
144
  G
145
145
 
146
146
  bundle :install, :artifice => "endpoint_marshal_fail"
147
- out.should include("\nFetching full source index from #{source_uri}")
147
+ expect(out).to include("\nFetching full source index from #{source_uri}")
148
148
  should_be_installed "rack 1.0.0"
149
149
  end
150
150
 
@@ -155,56 +155,7 @@ describe "gemcutter's dependency API" do
155
155
  G
156
156
 
157
157
  bundle :install, :artifice => "endpoint_redirect"
158
- out.should match(/Too many redirects/)
159
- end
160
-
161
- context "when Gemcutter API takes too long to respond" do
162
- before do
163
- # need to hack, so we can require rack
164
- old_gem_home = ENV['GEM_HOME']
165
- ENV['GEM_HOME'] = Spec::Path.base_system_gems.to_s
166
- require 'rack'
167
- ENV['GEM_HOME'] = old_gem_home
168
-
169
- port = 21453
170
- port += 1 while TCPSocket.new("127.0.0.1", port) rescue false
171
- @server_uri = "http://127.0.0.1:#{port}"
172
-
173
- require File.expand_path('../../../support/artifice/endpoint_timeout', __FILE__)
174
- require 'thread'
175
- @t = Thread.new {
176
- server = Rack::Server.start(:app => EndpointTimeout,
177
- :Host => '0.0.0.0',
178
- :Port => port,
179
- :server => 'webrick',
180
- :AccessLog => [])
181
- server.start
182
- }
183
- @t.run
184
-
185
- # ensure server is started
186
- require 'timeout'
187
- Timeout.timeout(15) { sleep(0.1) until @t.status == "sleep" }
188
- end
189
-
190
- after do
191
- @t.kill
192
- end
193
-
194
- it "times out and falls back on the modern index" do
195
- gemfile <<-G
196
- source "#{@server_uri}"
197
- gem "rack"
198
-
199
- old_v, $VERBOSE = $VERBOSE, nil
200
- Bundler::Fetcher::API_TIMEOUT = 1
201
- $VERBOSE = old_v
202
- G
203
-
204
- bundle :install
205
- expect(out).to include("\nFetching full source index from #{@server_uri}")
206
- should_be_installed "rack 1.0.0"
207
- end
158
+ expect(out).to match(/Too many redirects/)
208
159
  end
209
160
 
210
161
  context "when --full-index is specified" do
@@ -215,7 +166,7 @@ describe "gemcutter's dependency API" do
215
166
  G
216
167
 
217
168
  bundle "install --full-index", :artifice => "endpoint"
218
- out.should include("Fetching source index from #{source_uri}")
169
+ expect(out).to include("Fetching source index from #{source_uri}")
219
170
  should_be_installed "rack 1.0.0"
220
171
  end
221
172
 
@@ -226,7 +177,7 @@ describe "gemcutter's dependency API" do
226
177
  G
227
178
 
228
179
  bundle "update --full-index", :artifice => "endpoint"
229
- out.should include("Fetching source index from #{source_uri}")
180
+ expect(out).to include("Fetching source index from #{source_uri}")
230
181
  should_be_installed "rack 1.0.0"
231
182
  end
232
183
  end
@@ -269,7 +220,7 @@ describe "gemcutter's dependency API" do
269
220
  Fetching gem metadata from http://localgemserver.test/..
270
221
  Fetching gem metadata from http://localgemserver.test/extra/.
271
222
  OUTPUT
272
- out.should include(output)
223
+ expect(out).to include(output)
273
224
  end
274
225
 
275
226
  it "does not fetch every specs if the index of gems is large when doing back deps" do
@@ -335,10 +286,10 @@ OUTPUT
335
286
  G
336
287
 
337
288
  bundle :install, :artifice => "endpoint"
338
- out.should include("Fetching gem metadata from #{source_uri}")
289
+ expect(out).to include("Fetching gem metadata from #{source_uri}")
339
290
  end
340
291
 
341
- fit "should install when EndpointSpecification with a bin dir owned by root", :sudo => true do
292
+ it "should install when EndpointSpecification with a bin dir owned by root", :sudo => true do
342
293
  sudo "mkdir -p #{system_gem_path("bin")}"
343
294
  sudo "chown -R root #{system_gem_path("bin")}"
344
295
 
@@ -347,7 +298,6 @@ OUTPUT
347
298
  gem "rails"
348
299
  G
349
300
  bundle :install, :artifice => "endpoint"
350
- puts out, err
351
301
  should_be_installed "rails 2.3.2"
352
302
  end
353
303
 
@@ -360,7 +310,7 @@ OUTPUT
360
310
  bundle "install --binstubs", :artifice => "endpoint"
361
311
 
362
312
  gembin "rackup"
363
- out.should == "1.0.0"
313
+ expect(out).to eq("1.0.0")
364
314
  end
365
315
 
366
316
  it "installs the bins when using --path and uses autoclean" do
@@ -371,7 +321,7 @@ OUTPUT
371
321
 
372
322
  bundle "install --path vendor/bundle", :artifice => "endpoint"
373
323
 
374
- vendored_gems("bin/rackup").should exist
324
+ expect(vendored_gems("bin/rackup")).to exist
375
325
  end
376
326
 
377
327
  it "installs the bins when using --path and uses bundle clean" do
@@ -382,7 +332,7 @@ OUTPUT
382
332
 
383
333
  bundle "install --path vendor/bundle --no-clean", :artifice => "endpoint"
384
334
 
385
- vendored_gems("bin/rackup").should exist
335
+ expect(vendored_gems("bin/rackup")).to exist
386
336
  end
387
337
 
388
338
  it "prints post_install_messages" do
@@ -392,7 +342,7 @@ OUTPUT
392
342
  G
393
343
 
394
344
  bundle :install, :artifice => "endpoint"
395
- out.should include("Post-install message from rack:")
345
+ expect(out).to include("Post-install message from rack:")
396
346
  end
397
347
 
398
348
  it "should display the post install message for a dependency" do
@@ -402,8 +352,8 @@ OUTPUT
402
352
  G
403
353
 
404
354
  bundle :install, :artifice => "endpoint"
405
- out.should include("Post-install message from rack:")
406
- out.should include("Rack's post install message")
355
+ expect(out).to include("Post-install message from rack:")
356
+ expect(out).to include("Rack's post install message")
407
357
  end
408
358
 
409
359
  context "when using basic authentication" do
@@ -424,7 +374,7 @@ OUTPUT
424
374
  G
425
375
 
426
376
  bundle :install, :artifice => "endpoint_basic_authentication"
427
- out.should_not include("#{user}:#{password}")
377
+ expect(out).not_to include("#{user}:#{password}")
428
378
  should_be_installed "rack 1.0.0"
429
379
  end
430
380
 
@@ -435,7 +385,7 @@ OUTPUT
435
385
  G
436
386
 
437
387
  bundle :install, :artifice => "endopint_marshal_fail_basic_authentication"
438
- out.should_not include("#{user}:#{password}")
388
+ expect(out).not_to include("#{user}:#{password}")
439
389
  should_be_installed "rack 1.0.0"
440
390
  end
441
391
 
@@ -446,7 +396,7 @@ OUTPUT
446
396
  G
447
397
 
448
398
  bundle :install, :artifice => "endpoint_500"
449
- out.should_not include("#{user}:#{password}")
399
+ expect(out).not_to include("#{user}:#{password}")
450
400
  end
451
401
  end
452
402
 
@@ -479,50 +429,7 @@ OUTPUT
479
429
 
480
430
  bundle :install, :artifice => "endpoint",
481
431
  :env => {"RUBYOPT" => "-I#{bundled_app("broken_ssl")}"}
482
- out.should include("Could not load OpenSSL.")
483
- end
484
- end
485
-
486
- context "when SSL certificate verification fails" do
487
- it "explains what is going on" do
488
- # Install a monkeypatch that reproduces the effects of openssl raising
489
- # a certificate validation error at the appropriate moment.
490
- gemfile <<-G
491
- class Bundler::Fetcher
492
- def fetch_all_remote_specs
493
- raise OpenSSL::SSL::SSLError, "Certificate invalid"
494
- end
495
- end
496
-
497
- source "#{source_uri.gsub(/http/, 'https')}"
498
- gem "rack"
499
- G
500
-
501
- bundle :install
502
- expect(out).to match(/could not verify the SSL certificate/i)
503
- end
504
- end
505
-
506
- context ".gemrc with sources is present" do
507
- before do
508
- File.open(home('.gemrc'), 'w') do |file|
509
- file.puts({:sources => ["https://rubygems.org"]}.to_yaml)
510
- end
511
- end
512
-
513
- after do
514
- home('.gemrc').rmtree
515
- end
516
-
517
- it "uses other sources declared in the Gemfile" do
518
- gemfile <<-G
519
- source "#{source_uri}"
520
- gem 'rack'
521
- G
522
-
523
- bundle "install", :exitstatus => true, :artifice => "endpoint_marshal_fail"
524
-
525
- expect(exitstatus).to eq(0)
432
+ expect(out).to include("Could not load OpenSSL.")
526
433
  end
527
434
  end
528
435