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.
- data/.gitignore +10 -7
- data/.travis.yml +12 -3
- data/CHANGELOG.md +26 -19
- data/CONTRIBUTE.md +97 -0
- data/README.md +4 -2
- data/Rakefile +17 -59
- data/bundler.gemspec +2 -1
- data/lib/bundler.rb +23 -20
- data/lib/bundler/cli.rb +68 -22
- data/lib/bundler/definition.rb +3 -2
- data/lib/bundler/deprecate.rb +15 -0
- data/lib/bundler/dsl.rb +14 -16
- data/lib/bundler/environment.rb +0 -5
- data/lib/bundler/fetcher.rb +23 -78
- data/lib/bundler/friendly_errors.rb +4 -5
- data/lib/bundler/gem_helper.rb +14 -16
- data/lib/bundler/injector.rb +64 -0
- data/lib/bundler/installer.rb +1 -7
- data/lib/bundler/lazy_specification.rb +6 -3
- data/lib/bundler/lockfile_parser.rb +25 -13
- data/lib/bundler/resolver.rb +0 -1
- data/lib/bundler/rubygems_integration.rb +83 -17
- data/lib/bundler/settings.rb +4 -2
- data/lib/bundler/similarity_detector.rb +63 -0
- data/lib/bundler/source.rb +3 -886
- data/lib/bundler/source/git.rb +267 -0
- data/lib/bundler/source/git/git_proxy.rb +142 -0
- data/lib/bundler/source/path.rb +209 -0
- data/lib/bundler/source/path/installer.rb +33 -0
- data/lib/bundler/source/rubygems.rb +261 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -0
- data/lib/bundler/templates/newgem/rspec.tt +2 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
- data/lib/bundler/templates/newgem/test/minitest_helper.rb.tt +4 -0
- data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +11 -0
- data/lib/bundler/ui.rb +20 -5
- data/lib/bundler/vendor/.document +0 -0
- data/lib/bundler/vendor/thor.rb +74 -5
- data/lib/bundler/vendor/thor/actions.rb +5 -5
- data/lib/bundler/vendor/thor/actions/directory.rb +1 -0
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +7 -1
- data/lib/bundler/vendor/thor/base.rb +44 -11
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +5 -0
- data/lib/bundler/vendor/thor/parser/argument.rb +14 -7
- data/lib/bundler/vendor/thor/parser/arguments.rb +7 -1
- data/lib/bundler/vendor/thor/parser/option.rb +8 -8
- data/lib/bundler/vendor/thor/parser/options.rb +62 -24
- data/lib/bundler/vendor/thor/runner.rb +1 -1
- data/lib/bundler/vendor/thor/shell/basic.rb +2 -2
- data/lib/bundler/vendor/thor/task.rb +2 -2
- data/lib/bundler/vendor/thor/version.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +3 -15
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-exec.ronn +1 -1
- data/man/bundle-update.ronn +1 -1
- data/man/bundle.ronn +4 -1
- data/spec/bundler/bundler_spec.rb +2 -28
- data/spec/bundler/cli_rspec.rb +9 -0
- data/spec/bundler/definition_spec.rb +1 -1
- data/spec/bundler/dsl_spec.rb +15 -8
- data/spec/bundler/gem_helper_spec.rb +38 -21
- data/spec/bundler/psyched_yaml_spec.rb +1 -0
- data/spec/bundler/source_spec.rb +3 -3
- data/spec/cache/gems_spec.rb +24 -24
- data/spec/cache/git_spec.rb +21 -23
- data/spec/cache/path_spec.rb +11 -11
- data/spec/cache/platform_spec.rb +6 -6
- data/spec/install/deploy_spec.rb +38 -38
- data/spec/install/gems/c_ext_spec.rb +2 -2
- data/spec/install/gems/dependency_api_spec.rb +23 -116
- data/spec/install/gems/env_spec.rb +1 -1
- data/spec/install/gems/flex_spec.rb +7 -8
- data/spec/install/gems/groups_spec.rb +10 -10
- data/spec/install/gems/packed_spec.rb +4 -4
- data/spec/install/gems/platform_spec.rb +3 -3
- data/spec/install/gems/post_install_spec.rb +9 -9
- data/spec/install/gems/resolving_spec.rb +2 -2
- data/spec/install/gems/simple_case_spec.rb +50 -53
- data/spec/install/gems/standalone_spec.rb +19 -19
- data/spec/install/gems/sudo_spec.rb +31 -16
- data/spec/install/gems/win32_spec.rb +1 -1
- data/spec/install/gemspec_spec.rb +6 -6
- data/spec/install/git_spec.rb +34 -34
- data/spec/install/invalid_spec.rb +3 -3
- data/spec/install/path_spec.rb +71 -8
- data/spec/install/upgrade_spec.rb +2 -2
- data/spec/integration/inject.rb +78 -0
- data/spec/lock/git_spec.rb +2 -2
- data/spec/lock/lockfile_spec.rb +14 -14
- data/spec/other/check_spec.rb +29 -29
- data/spec/other/clean_spec.rb +47 -48
- data/spec/other/config_spec.rb +20 -20
- data/spec/other/console_spec.rb +5 -5
- data/spec/other/exec_spec.rb +48 -28
- data/spec/other/ext_spec.rb +3 -3
- data/spec/other/help_spec.rb +6 -6
- data/spec/other/init_spec.rb +8 -8
- data/spec/other/newgem_spec.rb +95 -15
- data/spec/other/open_spec.rb +10 -5
- data/spec/other/outdated_spec.rb +8 -8
- data/spec/other/platform_spec.rb +45 -45
- data/spec/other/show_spec.rb +10 -10
- data/spec/quality_spec.rb +2 -2
- data/spec/realworld/dependency_api_spec.rb +61 -0
- data/spec/realworld/edgecases_spec.rb +8 -8
- data/spec/runtime/executable_spec.rb +13 -13
- data/spec/runtime/load_spec.rb +12 -12
- data/spec/runtime/platform_spec.rb +1 -1
- data/spec/runtime/require_spec.rb +24 -24
- data/spec/runtime/setup_spec.rb +113 -56
- data/spec/runtime/with_clean_env_spec.rb +11 -13
- data/spec/spec_helper.rb +6 -0
- data/spec/support/artifice/endpoint.rb +28 -13
- data/spec/support/artifice/endpoint_extra.rb +4 -0
- data/spec/support/builders.rb +1 -1
- data/spec/support/helpers.rb +2 -7
- data/spec/support/indexes.rb +3 -3
- data/spec/support/matchers.rb +6 -6
- data/spec/update/gems_spec.rb +19 -8
- data/spec/update/git_spec.rb +10 -10
- data/spec/update/source_spec.rb +1 -1
- metadata +86 -55
- data/.rspec +0 -2
data/spec/cache/git_spec.rb
CHANGED
@@ -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).
|
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).
|
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}").
|
27
|
-
bundled_app("vendor/cache/foo-1.0-#{ref}/.git").
|
28
|
-
bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache").
|
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}").
|
46
|
-
bundled_app("vendor/cache/foo-1.0-#{ref}/.git").
|
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.
|
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.
|
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}").
|
88
|
-
bundled_app("vendor/cache/foo-1.0-#{old_ref}").
|
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.
|
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}").
|
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.
|
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}").
|
140
|
-
bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0").
|
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
|
-
|
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.
|
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
|
-
|
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.
|
166
|
+
expect(out).not_to include("Your Gemfile contains path and git dependencies.")
|
169
167
|
end
|
170
168
|
end
|
171
|
-
end
|
169
|
+
end
|
data/spec/cache/path_spec.rb
CHANGED
@@ -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").
|
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").
|
26
|
-
bundled_app("vendor/cache/foo-1.0/.bundlecache").
|
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").
|
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.
|
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").
|
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.
|
80
|
-
bundled_app("vendor/cache/foo-1.0").
|
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").
|
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").
|
118
|
+
expect(bundled_app("vendor/cache/baz-1.0")).not_to exist
|
119
119
|
end
|
120
120
|
end
|
121
|
-
end
|
121
|
+
end
|
data/spec/cache/platform_spec.rb
CHANGED
@@ -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").
|
46
|
-
bundled_app("vendor/cache/activesupport-2.3.5.gem").
|
47
|
-
bundled_app("vendor/cache/activerecord-2.3.2.gem").
|
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").
|
54
|
-
bundled_app("vendor/cache/activesupport-2.3.5.gem").
|
55
|
-
bundled_app("vendor/cache/activerecord-2.3.2.gem").
|
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
|
data/spec/install/deploy_spec.rb
CHANGED
@@ -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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
94
|
-
out.
|
95
|
-
out.
|
96
|
-
out.
|
97
|
-
out.
|
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.
|
110
|
-
out.
|
111
|
-
out.
|
112
|
-
out.
|
113
|
-
out.
|
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.
|
125
|
-
out.
|
126
|
-
out.
|
127
|
-
out.
|
128
|
-
out.
|
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.
|
139
|
-
out.
|
140
|
-
out.
|
141
|
-
out.
|
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.
|
152
|
-
out.
|
153
|
-
out.
|
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.
|
171
|
-
out.
|
172
|
-
out.
|
173
|
-
out.
|
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.
|
194
|
-
out.
|
195
|
-
out.
|
196
|
-
out.
|
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.
|
43
|
+
expect(out).not_to include("extconf.rb failed")
|
44
44
|
|
45
45
|
run "Bundler.require; puts CExtension.new.its_true"
|
46
|
-
out.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
289
|
+
expect(out).to include("Fetching gem metadata from #{source_uri}")
|
339
290
|
end
|
340
291
|
|
341
|
-
|
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.
|
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").
|
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").
|
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.
|
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.
|
406
|
-
out.
|
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.
|
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.
|
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.
|
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.
|
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
|
|