bundler 1.7.15 → 1.8.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 (191) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -14
  3. data/.rspec +1 -0
  4. data/.travis.yml +22 -15
  5. data/CHANGELOG.md +43 -13
  6. data/CODE_OF_CONDUCT.md +40 -0
  7. data/CONTRIBUTING.md +14 -12
  8. data/DEVELOPMENT.md +4 -2
  9. data/ISSUES.md +1 -1
  10. data/README.md +10 -14
  11. data/Rakefile +10 -10
  12. data/bin/bundle +1 -1
  13. data/bundler.gemspec +5 -4
  14. data/lib/bundler.rb +22 -3
  15. data/lib/bundler/anonymizable_uri.rb +24 -8
  16. data/lib/bundler/cli.rb +103 -66
  17. data/lib/bundler/cli/cache.rb +1 -0
  18. data/lib/bundler/cli/clean.rb +11 -4
  19. data/lib/bundler/cli/common.rb +2 -0
  20. data/lib/bundler/cli/console.rb +22 -26
  21. data/lib/bundler/cli/exec.rb +29 -22
  22. data/lib/bundler/cli/gem.rb +125 -37
  23. data/lib/bundler/cli/install.rb +22 -9
  24. data/lib/bundler/cli/outdated.rb +1 -1
  25. data/lib/bundler/cli/package.rb +8 -1
  26. data/lib/bundler/cli/show.rb +29 -3
  27. data/lib/bundler/cli/update.rb +2 -2
  28. data/lib/bundler/cli/viz.rb +1 -1
  29. data/lib/bundler/definition.rb +14 -22
  30. data/lib/bundler/dependency.rb +8 -1
  31. data/lib/bundler/dsl.rb +17 -4
  32. data/lib/bundler/endpoint_specification.rb +1 -1
  33. data/lib/bundler/env.rb +44 -25
  34. data/lib/bundler/fetcher.rb +33 -25
  35. data/lib/bundler/friendly_errors.rb +38 -5
  36. data/lib/bundler/gem_helper.rb +16 -10
  37. data/lib/bundler/gem_helpers.rb +1 -0
  38. data/lib/bundler/graph.rb +4 -1
  39. data/lib/bundler/index.rb +15 -25
  40. data/lib/bundler/installer.rb +6 -6
  41. data/lib/bundler/lockfile_parser.rb +7 -7
  42. data/lib/bundler/resolver.rb +2 -1
  43. data/lib/bundler/ruby_version.rb +1 -1
  44. data/lib/bundler/rubygems_ext.rb +1 -0
  45. data/lib/bundler/rubygems_integration.rb +1 -1
  46. data/lib/bundler/runtime.rb +22 -40
  47. data/lib/bundler/settings.rb +14 -5
  48. data/lib/bundler/setup.rb +2 -1
  49. data/lib/bundler/shared_helpers.rb +56 -4
  50. data/lib/bundler/source.rb +8 -9
  51. data/lib/bundler/source/git.rb +5 -1
  52. data/lib/bundler/source/git/git_proxy.rb +4 -0
  53. data/lib/bundler/source/path.rb +8 -11
  54. data/lib/bundler/source/path/installer.rb +0 -2
  55. data/lib/bundler/source/rubygems.rb +58 -72
  56. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +13 -0
  57. data/lib/bundler/templates/newgem/LICENSE.txt.tt +17 -18
  58. data/lib/bundler/templates/newgem/README.md.tt +9 -1
  59. data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
  60. data/lib/bundler/templates/newgem/bin/console.tt +14 -0
  61. data/lib/bundler/templates/newgem/bin/setup.tt +7 -0
  62. data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  63. data/lib/bundler/templates/newgem/gitignore.tt +2 -0
  64. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +1 -1
  65. data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -13
  66. data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +1 -1
  67. data/lib/bundler/ui/shell.rb +1 -1
  68. data/lib/bundler/version.rb +1 -1
  69. data/lib/bundler/worker.rb +73 -0
  70. data/man/bundle-config.ronn +17 -15
  71. data/man/bundle-install.ronn +102 -93
  72. data/man/bundle-update.ronn +39 -30
  73. data/man/bundle.ronn +6 -0
  74. data/man/gemfile.5.ronn +74 -13
  75. metadata +10 -231
  76. data/lib/bundler/parallel_workers.rb +0 -18
  77. data/lib/bundler/parallel_workers/thread_worker.rb +0 -30
  78. data/lib/bundler/parallel_workers/unix_worker.rb +0 -101
  79. data/lib/bundler/parallel_workers/worker.rb +0 -69
  80. data/lib/bundler/templates/newgem/bin/newgem.tt +0 -3
  81. data/spec/bundler/anonymizable_uri_spec.rb +0 -32
  82. data/spec/bundler/bundler_spec.rb +0 -72
  83. data/spec/bundler/cli_spec.rb +0 -16
  84. data/spec/bundler/definition_spec.rb +0 -22
  85. data/spec/bundler/dsl_spec.rb +0 -82
  86. data/spec/bundler/friendly_errors_spec.rb +0 -13
  87. data/spec/bundler/gem_helper_spec.rb +0 -226
  88. data/spec/bundler/psyched_yaml_spec.rb +0 -8
  89. data/spec/bundler/retry_spec.rb +0 -59
  90. data/spec/bundler/settings_spec.rb +0 -13
  91. data/spec/bundler/source/rubygems_spec.rb +0 -25
  92. data/spec/bundler/source_list_spec.rb +0 -361
  93. data/spec/cache/gems_spec.rb +0 -284
  94. data/spec/cache/git_spec.rb +0 -188
  95. data/spec/cache/path_spec.rb +0 -121
  96. data/spec/cache/platform_spec.rb +0 -57
  97. data/spec/commands/binstubs_spec.rb +0 -219
  98. data/spec/commands/check_spec.rb +0 -278
  99. data/spec/commands/clean_spec.rb +0 -592
  100. data/spec/commands/config_spec.rb +0 -263
  101. data/spec/commands/console_spec.rb +0 -76
  102. data/spec/commands/exec_spec.rb +0 -309
  103. data/spec/commands/help_spec.rb +0 -39
  104. data/spec/commands/init_spec.rb +0 -39
  105. data/spec/commands/inject_spec.rb +0 -78
  106. data/spec/commands/licenses_spec.rb +0 -18
  107. data/spec/commands/newgem_spec.rb +0 -428
  108. data/spec/commands/open_spec.rb +0 -68
  109. data/spec/commands/outdated_spec.rb +0 -156
  110. data/spec/commands/package_spec.rb +0 -114
  111. data/spec/commands/show_spec.rb +0 -125
  112. data/spec/install/binstubs_spec.rb +0 -24
  113. data/spec/install/bundler_spec.rb +0 -146
  114. data/spec/install/deploy_spec.rb +0 -250
  115. data/spec/install/gemfile/gemspec_spec.rb +0 -170
  116. data/spec/install/gemfile/git_spec.rb +0 -967
  117. data/spec/install/gemfile/path_spec.rb +0 -500
  118. data/spec/install/gemfile_spec.rb +0 -44
  119. data/spec/install/gems/c_ext_spec.rb +0 -48
  120. data/spec/install/gems/dependency_api_spec.rb +0 -652
  121. data/spec/install/gems/env_spec.rb +0 -107
  122. data/spec/install/gems/flex_spec.rb +0 -314
  123. data/spec/install/gems/groups_spec.rb +0 -308
  124. data/spec/install/gems/mirror_spec.rb +0 -39
  125. data/spec/install/gems/platform_spec.rb +0 -195
  126. data/spec/install/gems/post_install_spec.rb +0 -121
  127. data/spec/install/gems/resolving_spec.rb +0 -124
  128. data/spec/install/gems/simple_case_spec.rb +0 -377
  129. data/spec/install/gems/sources_spec.rb +0 -386
  130. data/spec/install/gems/standalone_spec.rb +0 -260
  131. data/spec/install/gems/sudo_spec.rb +0 -136
  132. data/spec/install/gems/win32_spec.rb +0 -26
  133. data/spec/install/gemspecs_spec.rb +0 -50
  134. data/spec/install/path_spec.rb +0 -150
  135. data/spec/install/post_bundle_message_spec.rb +0 -142
  136. data/spec/install/prereleases_spec.rb +0 -43
  137. data/spec/install/security_policy_spec.rb +0 -77
  138. data/spec/install/upgrade_spec.rb +0 -26
  139. data/spec/lock/git_spec.rb +0 -34
  140. data/spec/lock/lockfile_spec.rb +0 -924
  141. data/spec/other/bundle_ruby_spec.rb +0 -142
  142. data/spec/other/cli_dispatch_spec.rb +0 -21
  143. data/spec/other/ext_spec.rb +0 -60
  144. data/spec/other/platform_spec.rb +0 -1285
  145. data/spec/other/ssl_cert_spec.rb +0 -23
  146. data/spec/quality_spec.rb +0 -88
  147. data/spec/realworld/dependency_api_spec.rb +0 -60
  148. data/spec/realworld/edgecases_spec.rb +0 -212
  149. data/spec/realworld/parallel_spec.rb +0 -71
  150. data/spec/resolver/basic_spec.rb +0 -66
  151. data/spec/resolver/platform_spec.rb +0 -88
  152. data/spec/runtime/executable_spec.rb +0 -149
  153. data/spec/runtime/load_spec.rb +0 -107
  154. data/spec/runtime/platform_spec.rb +0 -90
  155. data/spec/runtime/require_spec.rb +0 -332
  156. data/spec/runtime/setup_spec.rb +0 -853
  157. data/spec/runtime/with_clean_env_spec.rb +0 -91
  158. data/spec/spec_helper.rb +0 -123
  159. data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +0 -13
  160. data/spec/support/artifice/endpoint.rb +0 -71
  161. data/spec/support/artifice/endpoint_500.rb +0 -37
  162. data/spec/support/artifice/endpoint_api_forbidden.rb +0 -11
  163. data/spec/support/artifice/endpoint_api_missing.rb +0 -16
  164. data/spec/support/artifice/endpoint_basic_authentication.rb +0 -13
  165. data/spec/support/artifice/endpoint_creds_diff_host.rb +0 -38
  166. data/spec/support/artifice/endpoint_extra.rb +0 -31
  167. data/spec/support/artifice/endpoint_extra_api.rb +0 -32
  168. data/spec/support/artifice/endpoint_extra_missing.rb +0 -15
  169. data/spec/support/artifice/endpoint_fallback.rb +0 -17
  170. data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
  171. data/spec/support/artifice/endpoint_marshal_fail.rb +0 -11
  172. data/spec/support/artifice/endpoint_redirect.rb +0 -15
  173. data/spec/support/artifice/endpoint_strict_basic_authentication.rb +0 -18
  174. data/spec/support/artifice/endpoint_timeout.rb +0 -13
  175. data/spec/support/builders.rb +0 -693
  176. data/spec/support/fakeweb/rack-1.0.0.marshal +0 -2
  177. data/spec/support/fakeweb/windows.rb +0 -23
  178. data/spec/support/hax.rb +0 -22
  179. data/spec/support/helpers.rb +0 -361
  180. data/spec/support/indexes.rb +0 -280
  181. data/spec/support/matchers.rb +0 -77
  182. data/spec/support/path.rb +0 -85
  183. data/spec/support/permissions.rb +0 -10
  184. data/spec/support/platforms.rb +0 -94
  185. data/spec/support/ruby_ext.rb +0 -20
  186. data/spec/support/rubygems_ext.rb +0 -39
  187. data/spec/support/streams.rb +0 -13
  188. data/spec/support/sudo.rb +0 -16
  189. data/spec/update/gems_spec.rb +0 -201
  190. data/spec/update/git_spec.rb +0 -283
  191. data/spec/update/path_spec.rb +0 -18
@@ -1,68 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle open" do
4
- before :each do
5
- install_gemfile <<-G
6
- source "file://#{gem_repo1}"
7
- gem "rails"
8
- G
9
- end
10
-
11
- it "opens the gem with BUNDLER_EDITOR as highest priority" do
12
- bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"}
13
- expect(out).to eq("bundler_editor #{default_bundle_path('gems', 'rails-2.3.2')}")
14
- end
15
-
16
- it "opens the gem with VISUAL as 2nd highest priority" do
17
- bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => ""}
18
- expect(out).to eq("visual #{default_bundle_path('gems', 'rails-2.3.2')}")
19
- end
20
-
21
- it "opens the gem with EDITOR as 3rd highest priority" do
22
- bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
23
- expect(out).to eq("editor #{default_bundle_path('gems', 'rails-2.3.2')}")
24
- end
25
-
26
- it "complains if no EDITOR is set" do
27
- bundle "open rails", :env => {"EDITOR" => "", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
28
- expect(out).to eq("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR")
29
- end
30
-
31
- it "complains if gem not in bundle" do
32
- bundle "open missing", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
33
- expect(out).to match(/could not find gem 'missing'/i)
34
- end
35
-
36
- it "does not blow up if the gem to open does not have a Gemfile" do
37
- git = build_git "foo"
38
- ref = git.ref_for("master", 11)
39
-
40
- install_gemfile <<-G
41
- source "file://#{gem_repo1}"
42
- gem 'foo', :git => "#{lib_path("foo-1.0")}"
43
- G
44
-
45
- bundle "open foo", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
46
- expect(out).to match("editor #{default_bundle_path.join("bundler/gems/foo-1.0-#{ref}")}")
47
- end
48
-
49
- it "suggests alternatives for similar-sounding gems" do
50
- bundle "open Rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
51
- expect(out).to match(/did you mean rails\?/i)
52
- end
53
-
54
- it "opens the gem with short words" do
55
- bundle "open rec" , :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"}
56
-
57
- expect(out).to eq("bundler_editor #{default_bundle_path('gems', 'activerecord-2.3.2')}")
58
- end
59
-
60
- it "select the gem from many match gems" do
61
- env = {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"}
62
- bundle "open active" , :env => env do |input|
63
- input.puts '2'
64
- end
65
-
66
- expect(out).to match(/bundler_editor #{default_bundle_path('gems', 'activerecord-2.3.2')}\z/)
67
- end
68
- end
@@ -1,156 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle outdated" do
4
- before :each do
5
- build_repo2 do
6
- build_git "foo", :path => lib_path("foo")
7
- build_git "zebra", :path => lib_path("zebra")
8
- end
9
-
10
- install_gemfile <<-G
11
- source "file://#{gem_repo2}"
12
- gem "zebra", :git => "#{lib_path('zebra')}"
13
- gem "foo", :git => "#{lib_path('foo')}"
14
- gem "activesupport", "2.3.5"
15
- gem "weakling", "~> 0.0.1"
16
- G
17
- end
18
-
19
- describe "with no arguments" do
20
- it "returns a sorted list of outdated gems" do
21
- update_repo2 do
22
- build_gem "activesupport", "3.0"
23
- build_gem "weakling", "0.2"
24
- update_git "foo", :path => lib_path("foo")
25
- update_git "zebra", :path => lib_path("zebra")
26
- end
27
-
28
- bundle "outdated"
29
-
30
- expect(out).to include("activesupport (3.0 > 2.3.5) Gemfile specifies \"= 2.3.5\"")
31
- expect(out).to include("weakling (0.2 > 0.0.3) Gemfile specifies \"~> 0.0.1\"")
32
- expect(out).to include("foo (1.0")
33
-
34
- # Gem names are one per-line, between "*" and their parenthesized version.
35
- gem_list = out.split("\n").map { |g| g[ /\* (.*) \(/, 1] }.compact
36
- expect(gem_list).to eq(gem_list.sort)
37
- end
38
-
39
- it "returns non zero exit status if outdated gems present" do
40
- update_repo2 do
41
- build_gem "activesupport", "3.0"
42
- update_git "foo", :path => lib_path("foo")
43
- end
44
-
45
- bundle "outdated", :exitstatus => true
46
-
47
- expect(exitstatus).to_not be_zero
48
- end
49
-
50
- it "returns success exit status if no outdated gems present" do
51
- bundle "outdated", :exitstatus => true
52
-
53
- expect(exitstatus).to be_zero
54
- end
55
- end
56
-
57
- describe "with --local option" do
58
- it "doesn't hit repo2" do
59
- FileUtils.rm_rf(gem_repo2)
60
-
61
- bundle "outdated --local"
62
- expect(out).not_to match(/Fetching/)
63
- end
64
- end
65
-
66
- describe "with specified gems" do
67
- it "returns list of outdated gems" do
68
- update_repo2 do
69
- build_gem "activesupport", "3.0"
70
- update_git "foo", :path => lib_path("foo")
71
- end
72
-
73
- bundle "outdated foo"
74
- expect(out).not_to include("activesupport (3.0 > 2.3.5)")
75
- expect(out).to include("foo (1.0")
76
- end
77
- end
78
-
79
- describe "pre-release gems" do
80
- context "without the --pre option" do
81
- it "ignores pre-release versions" do
82
- update_repo2 do
83
- build_gem "activesupport", "3.0.0.beta"
84
- end
85
-
86
- bundle "outdated"
87
- expect(out).not_to include("activesupport (3.0.0.beta > 2.3.5)")
88
- end
89
- end
90
-
91
- context "with the --pre option" do
92
- it "includes pre-release versions" do
93
- update_repo2 do
94
- build_gem "activesupport", "3.0.0.beta"
95
- end
96
-
97
- bundle "outdated --pre"
98
- expect(out).to include("activesupport (3.0.0.beta > 2.3.5) Gemfile specifies \"= 2.3.5\"")
99
- end
100
- end
101
-
102
- context "when current gem is a pre-release" do
103
- it "includes the gem" do
104
- update_repo2 do
105
- build_gem "activesupport", "3.0.0.beta.1"
106
- build_gem "activesupport", "3.0.0.beta.2"
107
- end
108
-
109
- install_gemfile <<-G
110
- source "file://#{gem_repo2}"
111
- gem "activesupport", "3.0.0.beta.1"
112
- G
113
-
114
- bundle "outdated"
115
- expect(out).to include("activesupport (3.0.0.beta.2 > 3.0.0.beta.1) Gemfile specifies \"= 3.0.0.beta.1\"")
116
- end
117
- end
118
- end
119
-
120
- describe "with --strict option" do
121
- it "only reports gems that have a newer version that matches the specified dependency version requirements" do
122
- update_repo2 do
123
- build_gem "activesupport", "3.0"
124
- build_gem "weakling", "0.0.5"
125
- end
126
-
127
- bundle "outdated --strict"
128
-
129
- expect(out).to_not include("activesupport (3.0 > 2.3.5) Gemfile specifies \"= 2.3.5\"")
130
- expect(out).to include("weakling (0.0.5 > 0.0.3) Gemfile specifies \"~> 0.0.1\"")
131
- end
132
-
133
- it "only reports gem dependencies when they can actually be updated" do
134
- install_gemfile <<-G
135
- source "file://#{gem_repo2}"
136
- gem "rack_middleware", "1.0"
137
- G
138
-
139
- bundle "outdated --strict"
140
-
141
- expect(out).to_not include("rack (1.2 > 0.9.1)")
142
- end
143
- end
144
-
145
- describe "with invalid gem name" do
146
- it "returns could not find gem name" do
147
- bundle "outdated invalid_gem_name"
148
- expect(out).to include("Could not find gem 'invalid_gem_name'.")
149
- end
150
-
151
- it "returns non-zero exit code" do
152
- bundle "outdated invalid_gem_name", :exitstatus => true
153
- expect(exitstatus).to_not be_zero
154
- end
155
- end
156
- end
@@ -1,114 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle package" do
4
- context "with --gemfile" do
5
- it "finds the gemfile" do
6
- gemfile bundled_app("NotGemfile"), <<-G
7
- source "file://#{gem_repo1}"
8
- gem 'rack'
9
- G
10
-
11
- bundle "package --gemfile=NotGemfile"
12
-
13
- ENV['BUNDLE_GEMFILE'] = "NotGemfile"
14
- should_be_installed "rack 1.0.0"
15
- end
16
- end
17
-
18
- context "with --path" do
19
- it "sets root directory for gems" do
20
- gemfile <<-D
21
- source "file://#{gem_repo1}"
22
- gem 'rack'
23
- D
24
-
25
- bundle "package --path=#{bundled_app('test')}"
26
-
27
- should_be_installed "rack 1.0.0"
28
- expect(bundled_app("test/vendor/cache/")).to exist
29
- end
30
- end
31
- end
32
-
33
- describe "bundle install with gem sources" do
34
- describe "when cached and locked" do
35
- it "does not hit the remote at all" do
36
- build_repo2
37
- install_gemfile <<-G
38
- source "file://#{gem_repo2}"
39
- gem "rack"
40
- G
41
-
42
- bundle :pack
43
- simulate_new_machine
44
- FileUtils.rm_rf gem_repo2
45
-
46
- bundle "install --local"
47
- should_be_installed "rack 1.0.0"
48
- end
49
-
50
- it "does not hit the remote at all" do
51
- build_repo2
52
- install_gemfile <<-G
53
- source "file://#{gem_repo2}"
54
- gem "rack"
55
- G
56
-
57
- bundle :pack
58
- simulate_new_machine
59
- FileUtils.rm_rf gem_repo2
60
-
61
- bundle "install --deployment"
62
- should_be_installed "rack 1.0.0"
63
- end
64
-
65
- it "does not reinstall already-installed gems" do
66
- install_gemfile <<-G
67
- source "file://#{gem_repo1}"
68
- gem "rack"
69
- G
70
- bundle :pack
71
-
72
- build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
73
- s.write "lib/rack.rb", "raise 'omg'"
74
- end
75
-
76
- bundle :install
77
- expect(err).to be_empty
78
- should_be_installed "rack 1.0"
79
- end
80
-
81
- it "ignores cached gems for the wrong platform" do
82
- simulate_platform "java" do
83
- install_gemfile <<-G
84
- source "file://#{gem_repo1}"
85
- gem "platform_specific"
86
- G
87
- bundle :pack
88
- end
89
-
90
- simulate_new_machine
91
-
92
- simulate_platform "ruby" do
93
- install_gemfile <<-G
94
- source "file://#{gem_repo1}"
95
- gem "platform_specific"
96
- G
97
- run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
98
- expect(out).to eq("1.0.0 RUBY")
99
- end
100
- end
101
-
102
- it "does not update the cache if --no-cache is passed" do
103
- gemfile <<-G
104
- source "file://#{gem_repo1}"
105
- gem "rack"
106
- G
107
- bundled_app("vendor/cache").mkpath
108
- expect(bundled_app("vendor/cache").children).to be_empty
109
-
110
- bundle "install --no-cache"
111
- expect(bundled_app("vendor/cache").children).to be_empty
112
- end
113
- end
114
- end
@@ -1,125 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle show" do
4
- context "with a standard Gemfile" do
5
- before :each do
6
- install_gemfile <<-G
7
- source "file://#{gem_repo1}"
8
- gem "rails"
9
- G
10
- end
11
-
12
- it "creates a Gemfile.lock if one did not exist" do
13
- FileUtils.rm("Gemfile.lock")
14
-
15
- bundle "show"
16
-
17
- expect(bundled_app("Gemfile.lock")).to exist
18
- end
19
-
20
- it "creates a Gemfile.lock when invoked with a gem name" do
21
- FileUtils.rm("Gemfile.lock")
22
-
23
- bundle "show rails"
24
-
25
- expect(bundled_app("Gemfile.lock")).to exist
26
- end
27
-
28
- it "prints path if gem exists in bundle" do
29
- bundle "show rails"
30
- expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
31
- end
32
-
33
- it "warns if path no longer exists on disk" do
34
- FileUtils.rm_rf("#{system_gem_path}/gems/rails-2.3.2")
35
-
36
- bundle "show rails"
37
-
38
- expect(out).to match(/has been deleted/i)
39
- expect(out).to include(default_bundle_path('gems', 'rails-2.3.2').to_s)
40
- end
41
-
42
- it "prints the path to the running bundler" do
43
- bundle "show bundler"
44
- expect(out).to eq(File.expand_path('../../../', __FILE__))
45
- end
46
-
47
- it "complains if gem not in bundle" do
48
- bundle "show missing"
49
- expect(out).to match(/could not find gem 'missing'/i)
50
- end
51
-
52
- it "prints path of all gems in bundle sorted by name" do
53
- bundle "show --paths"
54
-
55
- expect(out).to include(default_bundle_path('gems', 'rake-10.0.2').to_s)
56
- expect(out).to include(default_bundle_path('gems', 'rails-2.3.2').to_s)
57
-
58
- # Gem names are the last component of their path.
59
- gem_list = out.split.map { |p| p.split('/').last }
60
- expect(gem_list).to eq(gem_list.sort)
61
- end
62
-
63
- it "prints summary of gems" do
64
- bundle "show --verbose"
65
-
66
- expect(out).to include(' - This is just a fake gem for testing')
67
- expect(out).to include(' - Ruby based make-like utility.')
68
- end
69
- end
70
-
71
- context "with a git repo in the Gemfile" do
72
- before :each do
73
- @git = build_git "foo", "1.0"
74
- end
75
-
76
- it "prints out git info" do
77
- install_gemfile <<-G
78
- gem "foo", :git => "#{lib_path('foo-1.0')}"
79
- G
80
- should_be_installed "foo 1.0"
81
-
82
- bundle :show
83
- expect(out).to include("foo (1.0 #{@git.ref_for('master', 6)}")
84
- end
85
-
86
- it "prints out branch names other than master" do
87
- update_git "foo", :branch => "omg" do |s|
88
- s.write "lib/foo.rb", "FOO = '1.0.omg'"
89
- end
90
- @revision = revision_for(lib_path("foo-1.0"))[0...6]
91
-
92
- install_gemfile <<-G
93
- gem "foo", :git => "#{lib_path('foo-1.0')}", :branch => "omg"
94
- G
95
- should_be_installed "foo 1.0.omg"
96
-
97
- bundle :show
98
- expect(out).to include("foo (1.0 #{@git.ref_for('omg', 6)}")
99
- end
100
-
101
- it "doesn't print the branch when tied to a ref" do
102
- sha = revision_for(lib_path("foo-1.0"))
103
- install_gemfile <<-G
104
- gem "foo", :git => "#{lib_path('foo-1.0')}", :ref => "#{sha}"
105
- G
106
-
107
- bundle :show
108
- expect(out).to include("foo (1.0 #{sha[0..6]})")
109
- end
110
- end
111
-
112
- context "in a fresh gem in a blank git repo" do
113
- before :each do
114
- build_git "foo", :path => lib_path("foo")
115
- in_app_root_custom lib_path("foo")
116
- File.open('Gemfile', 'w') {|f| f.puts "gemspec" }
117
- sys_exec 'rm -rf .git && git init'
118
- end
119
-
120
- it "does not output git errors" do
121
- bundle :show
122
- expect(err).to be_empty
123
- end
124
- end
125
- end