bundler-maglev- 1.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/.gitignore +22 -0
  2. data/.travis.yml +32 -0
  3. data/CHANGELOG.md +805 -0
  4. data/ISSUES.md +62 -0
  5. data/LICENSE +23 -0
  6. data/README.md +29 -0
  7. data/Rakefile +212 -0
  8. data/UPGRADING.md +103 -0
  9. data/bin/bundle +22 -0
  10. data/bundler.gemspec +30 -0
  11. data/lib/bundler.rb +286 -0
  12. data/lib/bundler/capistrano.rb +11 -0
  13. data/lib/bundler/cli.rb +520 -0
  14. data/lib/bundler/definition.rb +438 -0
  15. data/lib/bundler/dependency.rb +134 -0
  16. data/lib/bundler/deployment.rb +58 -0
  17. data/lib/bundler/dsl.rb +257 -0
  18. data/lib/bundler/environment.rb +47 -0
  19. data/lib/bundler/gem_helper.rb +151 -0
  20. data/lib/bundler/gem_installer.rb +9 -0
  21. data/lib/bundler/gem_tasks.rb +2 -0
  22. data/lib/bundler/graph.rb +130 -0
  23. data/lib/bundler/index.rb +138 -0
  24. data/lib/bundler/installer.rb +97 -0
  25. data/lib/bundler/lazy_specification.rb +74 -0
  26. data/lib/bundler/lockfile_parser.rb +108 -0
  27. data/lib/bundler/remote_specification.rb +59 -0
  28. data/lib/bundler/resolver.rb +464 -0
  29. data/lib/bundler/rubygems_ext.rb +237 -0
  30. data/lib/bundler/rubygems_integration.rb +349 -0
  31. data/lib/bundler/runtime.rb +152 -0
  32. data/lib/bundler/settings.rb +115 -0
  33. data/lib/bundler/setup.rb +23 -0
  34. data/lib/bundler/shared_helpers.rb +71 -0
  35. data/lib/bundler/source.rb +708 -0
  36. data/lib/bundler/spec_set.rb +135 -0
  37. data/lib/bundler/templates/Executable +16 -0
  38. data/lib/bundler/templates/Gemfile +4 -0
  39. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  40. data/lib/bundler/templates/newgem/Rakefile.tt +1 -0
  41. data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
  42. data/lib/bundler/templates/newgem/gitignore.tt +4 -0
  43. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -0
  44. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  45. data/lib/bundler/templates/newgem/newgem.gemspec.tt +24 -0
  46. data/lib/bundler/ui.rb +73 -0
  47. data/lib/bundler/vendor/thor.rb +358 -0
  48. data/lib/bundler/vendor/thor/actions.rb +314 -0
  49. data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
  50. data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
  51. data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
  52. data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
  53. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +270 -0
  54. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +109 -0
  55. data/lib/bundler/vendor/thor/base.rb +576 -0
  56. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
  57. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  58. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
  59. data/lib/bundler/vendor/thor/error.rb +30 -0
  60. data/lib/bundler/vendor/thor/group.rb +273 -0
  61. data/lib/bundler/vendor/thor/invocation.rb +168 -0
  62. data/lib/bundler/vendor/thor/parser.rb +4 -0
  63. data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
  64. data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
  65. data/lib/bundler/vendor/thor/parser/option.rb +120 -0
  66. data/lib/bundler/vendor/thor/parser/options.rb +175 -0
  67. data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
  68. data/lib/bundler/vendor/thor/runner.rb +309 -0
  69. data/lib/bundler/vendor/thor/shell.rb +88 -0
  70. data/lib/bundler/vendor/thor/shell/basic.rb +302 -0
  71. data/lib/bundler/vendor/thor/shell/color.rb +108 -0
  72. data/lib/bundler/vendor/thor/shell/html.rb +121 -0
  73. data/lib/bundler/vendor/thor/task.rb +113 -0
  74. data/lib/bundler/vendor/thor/util.rb +229 -0
  75. data/lib/bundler/vendor/thor/version.rb +3 -0
  76. data/lib/bundler/vendored_thor.rb +7 -0
  77. data/lib/bundler/version.rb +6 -0
  78. data/lib/bundler/vlad.rb +11 -0
  79. data/man/bundle-config.ronn +90 -0
  80. data/man/bundle-exec.ronn +111 -0
  81. data/man/bundle-install.ronn +317 -0
  82. data/man/bundle-package.ronn +59 -0
  83. data/man/bundle-update.ronn +176 -0
  84. data/man/bundle.ronn +80 -0
  85. data/man/gemfile.5.ronn +284 -0
  86. data/man/index.txt +6 -0
  87. data/spec/bundler/gem_helper_spec.rb +143 -0
  88. data/spec/cache/gems_spec.rb +230 -0
  89. data/spec/cache/git_spec.rb +12 -0
  90. data/spec/cache/path_spec.rb +27 -0
  91. data/spec/cache/platform_spec.rb +57 -0
  92. data/spec/install/deploy_spec.rb +197 -0
  93. data/spec/install/deprecated_spec.rb +37 -0
  94. data/spec/install/gems/c_ext_spec.rb +48 -0
  95. data/spec/install/gems/env_spec.rb +107 -0
  96. data/spec/install/gems/flex_spec.rb +313 -0
  97. data/spec/install/gems/groups_spec.rb +259 -0
  98. data/spec/install/gems/packed_spec.rb +84 -0
  99. data/spec/install/gems/platform_spec.rb +192 -0
  100. data/spec/install/gems/resolving_spec.rb +72 -0
  101. data/spec/install/gems/simple_case_spec.rb +770 -0
  102. data/spec/install/gems/sudo_spec.rb +74 -0
  103. data/spec/install/gems/win32_spec.rb +26 -0
  104. data/spec/install/gemspec_spec.rb +125 -0
  105. data/spec/install/git_spec.rb +570 -0
  106. data/spec/install/invalid_spec.rb +35 -0
  107. data/spec/install/path_spec.rb +405 -0
  108. data/spec/install/upgrade_spec.rb +26 -0
  109. data/spec/lock/git_spec.rb +35 -0
  110. data/spec/lock/lockfile_spec.rb +739 -0
  111. data/spec/other/check_spec.rb +221 -0
  112. data/spec/other/config_spec.rb +40 -0
  113. data/spec/other/console_spec.rb +54 -0
  114. data/spec/other/exec_spec.rb +248 -0
  115. data/spec/other/ext_spec.rb +37 -0
  116. data/spec/other/help_spec.rb +39 -0
  117. data/spec/other/init_spec.rb +40 -0
  118. data/spec/other/newgem_spec.rb +46 -0
  119. data/spec/other/open_spec.rb +35 -0
  120. data/spec/other/show_spec.rb +82 -0
  121. data/spec/quality_spec.rb +62 -0
  122. data/spec/resolver/basic_spec.rb +20 -0
  123. data/spec/resolver/platform_spec.rb +82 -0
  124. data/spec/runtime/executable_spec.rb +110 -0
  125. data/spec/runtime/load_spec.rb +107 -0
  126. data/spec/runtime/platform_spec.rb +90 -0
  127. data/spec/runtime/require_spec.rb +231 -0
  128. data/spec/runtime/setup_spec.rb +730 -0
  129. data/spec/runtime/with_clean_env_spec.rb +15 -0
  130. data/spec/spec_helper.rb +92 -0
  131. data/spec/support/builders.rb +597 -0
  132. data/spec/support/helpers.rb +239 -0
  133. data/spec/support/indexes.rb +112 -0
  134. data/spec/support/matchers.rb +77 -0
  135. data/spec/support/path.rb +71 -0
  136. data/spec/support/platforms.rb +53 -0
  137. data/spec/support/ruby_ext.rb +20 -0
  138. data/spec/support/rubygems_ext.rb +37 -0
  139. data/spec/support/rubygems_hax/platform.rb +11 -0
  140. data/spec/support/sudo.rb +21 -0
  141. data/spec/update/gems_spec.rb +122 -0
  142. data/spec/update/git_spec.rb +196 -0
  143. data/spec/update/source_spec.rb +51 -0
  144. metadata +296 -0
@@ -0,0 +1,221 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle check" do
4
+ it "returns success when the Gemfile is satisfied" do
5
+ install_gemfile <<-G
6
+ source "file://#{gem_repo1}"
7
+ gem "rails"
8
+ G
9
+
10
+ bundle :check, :exitstatus => true
11
+ @exitstatus.should eq(0)
12
+ out.should == "The Gemfile's dependencies are satisfied"
13
+ end
14
+
15
+ it "works with the --gemfile flag when not in the directory" do
16
+ install_gemfile <<-G
17
+ source "file://#{gem_repo1}"
18
+ gem "rails"
19
+ G
20
+
21
+ Dir.chdir tmp
22
+ bundle "check --gemfile bundled_app/Gemfile"
23
+ out.should == "The Gemfile's dependencies are satisfied"
24
+ end
25
+
26
+ it "creates a Gemfile.lock if one did not exist" do
27
+ install_gemfile <<-G
28
+ source "file://#{gem_repo1}"
29
+ gem "rails"
30
+ G
31
+
32
+ FileUtils.rm("Gemfile.lock")
33
+
34
+ bundle "check"
35
+
36
+ bundled_app("Gemfile.lock").should exist
37
+ end
38
+
39
+ it "prints a generic error if the missing gems are unresolvable" do
40
+ system_gems ["rails-2.3.2"]
41
+
42
+ gemfile <<-G
43
+ source "file://#{gem_repo1}"
44
+ gem "rails"
45
+ G
46
+
47
+ bundle :check
48
+ out.should include("Your Gemfile's dependencies could not be satisfied")
49
+ end
50
+
51
+ it "prints a generic error if a Gemfile.lock does not exist and a toplevel dependency does not exist" do
52
+ gemfile <<-G
53
+ source "file://#{gem_repo1}"
54
+ gem "rails"
55
+ G
56
+
57
+ bundle :check, :exitstatus => true
58
+ @exitstatus.should be > 0
59
+ out.should include("could not be satisfied")
60
+ end
61
+
62
+ it "prints a generic message if you changed your lockfile" do
63
+ install_gemfile <<-G
64
+ source "file://#{gem_repo1}"
65
+ gem 'rails'
66
+ G
67
+ install_gemfile <<-G
68
+ source "file://#{gem_repo1}"
69
+ gem 'rails_fail'
70
+ G
71
+
72
+ gemfile <<-G
73
+ source "file://#{gem_repo1}"
74
+ gem "rails"
75
+ gem "rails_fail"
76
+ G
77
+
78
+ bundle :check
79
+ out.should include("Your Gemfile's dependencies could not be satisfied")
80
+ end
81
+
82
+ it "remembers --without option from install" do
83
+ gemfile <<-G
84
+ source "file://#{gem_repo1}"
85
+ group :foo do
86
+ gem "rack"
87
+ end
88
+ G
89
+
90
+ bundle "install --without foo"
91
+ bundle "check", :exitstatus => true
92
+ @exitstatus.should eq(0)
93
+ out.should include("The Gemfile's dependencies are satisfied")
94
+ end
95
+
96
+ it "ensures that gems are actually installed and not just cached" do
97
+ gemfile <<-G
98
+ source "file://#{gem_repo1}"
99
+ gem "rack", :group => :foo
100
+ G
101
+
102
+ bundle "install --without foo"
103
+
104
+ gemfile <<-G
105
+ source "file://#{gem_repo1}"
106
+ gem "rack"
107
+ G
108
+
109
+ bundle "check", :exitstatus => true
110
+ out.should include("* rack (1.0.0)")
111
+ @exitstatus.should == 1
112
+ end
113
+
114
+ it "ignores missing gems restricted to other platforms" do
115
+ system_gems "rack-1.0.0"
116
+
117
+ gemfile <<-G
118
+ source "file://#{gem_repo1}"
119
+ gem "rack"
120
+ platforms :#{not_local_tag} do
121
+ gem "activesupport"
122
+ end
123
+ G
124
+
125
+ lockfile <<-G
126
+ GEM
127
+ remote: file:#{gem_repo1}/
128
+ specs:
129
+ activesupport (2.3.5)
130
+ rack (1.0.0)
131
+
132
+ PLATFORMS
133
+ #{local}
134
+ #{not_local}
135
+
136
+ DEPENDENCIES
137
+ rack
138
+ activesupport
139
+ G
140
+
141
+ bundle :check
142
+ out.should == "The Gemfile's dependencies are satisfied"
143
+ end
144
+
145
+ it "works with env conditionals" do
146
+ system_gems "rack-1.0.0"
147
+
148
+ gemfile <<-G
149
+ source "file://#{gem_repo1}"
150
+ gem "rack"
151
+ env :NOT_GOING_TO_BE_SET do
152
+ gem "activesupport"
153
+ end
154
+ G
155
+
156
+ lockfile <<-G
157
+ GEM
158
+ remote: file:#{gem_repo1}/
159
+ specs:
160
+ activesupport (2.3.5)
161
+ rack (1.0.0)
162
+
163
+ PLATFORMS
164
+ #{local}
165
+ #{not_local}
166
+
167
+ DEPENDENCIES
168
+ rack
169
+ activesupport
170
+ G
171
+
172
+ bundle :check
173
+ out.should == "The Gemfile's dependencies are satisfied"
174
+ end
175
+
176
+ it "outputs an error when the default Gemfile is not found" do
177
+ bundle :check, :exitstatus => true
178
+ @exitstatus.should eq(10)
179
+ out.should include("Could not locate Gemfile")
180
+ end
181
+
182
+ it "should not crash when called multiple times on a new machine" do
183
+ gemfile <<-G
184
+ gem 'rails', '3.0.0.beta3'
185
+ gem 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git'
186
+ G
187
+
188
+ simulate_new_machine
189
+ bundle "check"
190
+ last_out = out
191
+ 3.times do |i|
192
+ bundle :check
193
+ out.should eq(last_out)
194
+ err.should be_empty
195
+ end
196
+ end
197
+
198
+ describe "when locked" do
199
+ before :each do
200
+ system_gems "rack-1.0.0"
201
+ install_gemfile <<-G
202
+ source "file://#{gem_repo1}"
203
+ gem "rack", "1.0"
204
+ G
205
+ end
206
+
207
+ it "returns success when the Gemfile is satisfied" do
208
+ bundle :install
209
+ bundle :check, :exitstatus => true
210
+ @exitstatus.should eq(0)
211
+ out.should == "The Gemfile's dependencies are satisfied"
212
+ end
213
+
214
+ it "shows what is missing with the current Gemfile if it is not satisfied" do
215
+ simulate_new_machine
216
+ bundle :check
217
+ out.should match(/The following gems are missing/)
218
+ out.should include("* rack (1.0")
219
+ end
220
+ end
221
+ end
@@ -0,0 +1,40 @@
1
+ require "spec_helper"
2
+
3
+ describe ".bundle/config" do
4
+ before :each do
5
+ gemfile <<-G
6
+ source "file://#{gem_repo1}"
7
+ gem "rack", "1.0.0"
8
+ G
9
+ end
10
+
11
+ it "can be moved with an environment variable" do
12
+ ENV['BUNDLE_APP_CONFIG'] = tmp('foo/bar').to_s
13
+ bundle "install --path vendor/bundle"
14
+
15
+ bundled_app('.bundle').should_not exist
16
+ tmp('foo/bar/config').should exist
17
+ should_be_installed "rack 1.0.0"
18
+ end
19
+
20
+ it "can provide a relative path with the environment variable" do
21
+ FileUtils.mkdir_p bundled_app('omg')
22
+ Dir.chdir bundled_app('omg')
23
+
24
+ ENV['BUNDLE_APP_CONFIG'] = "../foo"
25
+ bundle "install --path vendor/bundle"
26
+
27
+ bundled_app(".bundle").should_not exist
28
+ bundled_app("../foo/config").should exist
29
+ should_be_installed "rack 1.0.0"
30
+ end
31
+
32
+ it "removes environment.rb from BUNDLE_APP_CONFIG's path" do
33
+ FileUtils.mkdir_p(tmp('foo/bar'))
34
+ ENV['BUNDLE_APP_CONFIG'] = tmp('foo/bar').to_s
35
+ bundle "install"
36
+ FileUtils.touch tmp('foo/bar/environment.rb')
37
+ should_be_installed "rack 1.0.0"
38
+ tmp('foo/bar/environment.rb').should_not exist
39
+ end
40
+ end
@@ -0,0 +1,54 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle console" do
4
+ before :each do
5
+ install_gemfile <<-G
6
+ source "file://#{gem_repo1}"
7
+ gem "rack"
8
+ gem "activesupport", :group => :test
9
+ gem "rack_middleware", :group => :development
10
+ G
11
+ end
12
+
13
+ it "starts IRB with the default group loaded" do
14
+ bundle "console" do |input|
15
+ input.puts("puts RACK")
16
+ input.puts("exit")
17
+ end
18
+ out.should include("0.9.1")
19
+ end
20
+
21
+ it "doesn't load any other groups" do
22
+ bundle "console" do |input|
23
+ input.puts("puts ACTIVESUPPORT")
24
+ input.puts("exit")
25
+ end
26
+ out.should include("NameError")
27
+ end
28
+
29
+ describe "when given a group" do
30
+ it "loads the given group" do
31
+ bundle "console test" do |input|
32
+ input.puts("puts ACTIVESUPPORT")
33
+ input.puts("exit")
34
+ end
35
+ out.should include("2.3.5")
36
+ end
37
+
38
+ it "loads the default group" do
39
+ bundle "console test" do |input|
40
+ input.puts("puts RACK")
41
+ input.puts("exit")
42
+ end
43
+ out.should include("0.9.1")
44
+ end
45
+
46
+ it "doesn't load other groups" do
47
+ bundle "console test" do |input|
48
+ input.puts("puts RACK_MIDDLEWARE")
49
+ input.puts("exit")
50
+ end
51
+ out.should include("NameError")
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,248 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle exec" do
4
+ before :each do
5
+ system_gems "rack-1.0.0", "rack-0.9.1"
6
+ end
7
+
8
+ it "activates the correct gem" do
9
+ gemfile <<-G
10
+ gem "rack", "0.9.1"
11
+ G
12
+
13
+ bundle "exec rackup"
14
+ out.should == "0.9.1"
15
+ end
16
+
17
+ it "works when the bins are in ~/.bundle" do
18
+ install_gemfile <<-G
19
+ gem "rack"
20
+ G
21
+
22
+ bundle "exec rackup"
23
+ out.should == "1.0.0"
24
+ end
25
+
26
+ it "works when running from a random directory" do
27
+ install_gemfile <<-G
28
+ gem "rack"
29
+ G
30
+
31
+ bundle "exec 'cd #{tmp('gems')} && rackup'"
32
+
33
+ out.should == "1.0.0"
34
+ end
35
+
36
+ it "works when exec'ing something else" do
37
+ install_gemfile 'gem "rack"'
38
+ bundle "exec echo exec"
39
+ out.should == "exec"
40
+ end
41
+
42
+ it "handles different versions in different bundles" do
43
+ build_repo2 do
44
+ build_gem "rack_two", "1.0.0" do |s|
45
+ s.executables = "rackup"
46
+ end
47
+ end
48
+
49
+ install_gemfile <<-G
50
+ source "file://#{gem_repo1}"
51
+ gem "rack", "0.9.1"
52
+ G
53
+
54
+ Dir.chdir bundled_app2 do
55
+ install_gemfile bundled_app2('Gemfile'), <<-G
56
+ source "file://#{gem_repo2}"
57
+ gem "rack_two", "1.0.0"
58
+ G
59
+ end
60
+
61
+ bundle "exec rackup"
62
+
63
+ out.should eq("0.9.1")
64
+
65
+ Dir.chdir bundled_app2 do
66
+ bundle "exec rackup"
67
+ out.should == "1.0.0"
68
+ end
69
+ end
70
+
71
+ it "handles gems installed with --without" do
72
+ install_gemfile <<-G, :without => :middleware
73
+ source "file://#{gem_repo1}"
74
+ gem "rack" # rack 0.9.1 and 1.0 exist
75
+
76
+ group :middleware do
77
+ gem "rack_middleware" # rack_middleware depends on rack 0.9.1
78
+ end
79
+ G
80
+
81
+ bundle "exec rackup"
82
+
83
+ out.should eq("0.9.1")
84
+ should_not_be_installed "rack_middleware 1.0"
85
+ end
86
+
87
+ it "should not duplicate already exec'ed RUBYOPT or PATH" do
88
+ install_gemfile <<-G
89
+ gem "rack"
90
+ G
91
+
92
+ rubyopt = ENV['RUBYOPT']
93
+ rubyopt = "-I#{bundler_path} -rbundler/setup #{rubyopt}"
94
+
95
+ bundle "exec 'echo $RUBYOPT'"
96
+ out.should have_rubyopts(rubyopt)
97
+
98
+ bundle "exec 'echo $RUBYOPT'", :env => {"RUBYOPT" => rubyopt}
99
+ out.should have_rubyopts(rubyopt)
100
+ end
101
+
102
+ it "errors nicely when the argument doesn't exist" do
103
+ install_gemfile <<-G
104
+ gem "rack"
105
+ G
106
+
107
+ bundle "exec foobarbaz", :exitstatus => true
108
+ exitstatus.should eq(127)
109
+ out.should include("bundler: command not found: foobarbaz")
110
+ out.should include("Install missing gem executables with `bundle install`")
111
+ end
112
+
113
+ it "errors nicely when the argument is not executable" do
114
+ install_gemfile <<-G
115
+ gem "rack"
116
+ G
117
+
118
+ bundle "exec touch foo"
119
+ bundle "exec ./foo", :exitstatus => true
120
+ exitstatus.should eq(126)
121
+ out.should include("bundler: not executable: ./foo")
122
+ end
123
+
124
+ describe "with gem executables" do
125
+ describe "run from a random directory" do
126
+ before(:each) do
127
+ install_gemfile <<-G
128
+ gem "rack"
129
+ G
130
+ end
131
+
132
+ it "works when unlocked" do
133
+ bundle "exec 'cd #{tmp('gems')} && rackup'"
134
+ out.should == "1.0.0"
135
+ end
136
+
137
+ it "works when locked" do
138
+ bundle "lock"
139
+ should_be_locked
140
+ bundle "exec 'cd #{tmp('gems')} && rackup'"
141
+ out.should == "1.0.0"
142
+ end
143
+ end
144
+
145
+ describe "from gems bundled via :path" do
146
+ before(:each) do
147
+ build_lib "fizz", :path => home("fizz") do |s|
148
+ s.executables = "fizz"
149
+ end
150
+
151
+ install_gemfile <<-G
152
+ gem "fizz", :path => "#{File.expand_path(home("fizz"))}"
153
+ G
154
+ end
155
+
156
+ it "works when unlocked" do
157
+ bundle "exec fizz"
158
+ out.should == "1.0"
159
+ end
160
+
161
+ it "works when locked" do
162
+ bundle "lock"
163
+ should_be_locked
164
+
165
+ bundle "exec fizz"
166
+ out.should == "1.0"
167
+ end
168
+ end
169
+
170
+ describe "from gems bundled via :git" do
171
+ before(:each) do
172
+ build_git "fizz_git" do |s|
173
+ s.executables = "fizz_git"
174
+ end
175
+
176
+ install_gemfile <<-G
177
+ gem "fizz_git", :git => "#{lib_path('fizz_git-1.0')}"
178
+ G
179
+ end
180
+
181
+ it "works when unlocked" do
182
+ bundle "exec fizz_git"
183
+ out.should == "1.0"
184
+ end
185
+
186
+ it "works when locked" do
187
+ bundle "lock"
188
+ should_be_locked
189
+ bundle "exec fizz_git"
190
+ out.should == "1.0"
191
+ end
192
+ end
193
+
194
+ describe "from gems bundled via :git with no gemspec" do
195
+ before(:each) do
196
+ build_git "fizz_no_gemspec", :gemspec => false do |s|
197
+ s.executables = "fizz_no_gemspec"
198
+ end
199
+
200
+ install_gemfile <<-G
201
+ gem "fizz_no_gemspec", "1.0", :git => "#{lib_path('fizz_no_gemspec-1.0')}"
202
+ G
203
+ end
204
+
205
+ it "works when unlocked" do
206
+ bundle "exec fizz_no_gemspec"
207
+ out.should == "1.0"
208
+ end
209
+
210
+ it "works when locked" do
211
+ bundle "lock"
212
+ should_be_locked
213
+ bundle "exec fizz_no_gemspec"
214
+ out.should == "1.0"
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ describe "bundling bundler" do
221
+ before(:each) do
222
+ gemfile <<-G
223
+ source "file://#{gem_repo1}"
224
+ gem "rack"
225
+ G
226
+
227
+ bundle "install --path vendor/bundle --disable-shared-gems"
228
+ end
229
+
230
+ it "does not explode with --disable-shared-gems" do
231
+ bundle "exec bundle check", :exitstatus => true
232
+ exitstatus.should == 0
233
+ end
234
+
235
+ it "does not explode when starting with Bundler.setup" do
236
+ ruby <<-R
237
+ require "rubygems"
238
+ require "bundler"
239
+ Bundler.setup
240
+ puts `bundle check`
241
+ puts $?.exitstatus
242
+ R
243
+
244
+ out.should include("satisfied")
245
+ out.should include("\n0")
246
+ end
247
+ end
248
+ end