bundler_package_git 1.1.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data/.gitignore +22 -0
  2. data/.rvmrc +1 -0
  3. data/CHANGELOG.md +659 -0
  4. data/ISSUES.md +47 -0
  5. data/LICENSE +23 -0
  6. data/README.md +29 -0
  7. data/Rakefile +167 -0
  8. data/UPGRADING.md +103 -0
  9. data/bin/bundle +22 -0
  10. data/bundler.gemspec +30 -0
  11. data/lib/bundler.rb +283 -0
  12. data/lib/bundler/capistrano.rb +11 -0
  13. data/lib/bundler/cli.rb +490 -0
  14. data/lib/bundler/definition.rb +429 -0
  15. data/lib/bundler/dependency.rb +130 -0
  16. data/lib/bundler/deployment.rb +53 -0
  17. data/lib/bundler/dsl.rb +243 -0
  18. data/lib/bundler/environment.rb +47 -0
  19. data/lib/bundler/fetcher.rb +101 -0
  20. data/lib/bundler/gem_helper.rb +146 -0
  21. data/lib/bundler/graph.rb +130 -0
  22. data/lib/bundler/index.rb +131 -0
  23. data/lib/bundler/installer.rb +117 -0
  24. data/lib/bundler/lazy_specification.rb +71 -0
  25. data/lib/bundler/lockfile_parser.rb +108 -0
  26. data/lib/bundler/remote_specification.rb +57 -0
  27. data/lib/bundler/resolver.rb +470 -0
  28. data/lib/bundler/rubygems_ext.rb +226 -0
  29. data/lib/bundler/runtime.rb +201 -0
  30. data/lib/bundler/settings.rb +117 -0
  31. data/lib/bundler/setup.rb +16 -0
  32. data/lib/bundler/shared_helpers.rb +167 -0
  33. data/lib/bundler/source.rb +675 -0
  34. data/lib/bundler/spec_set.rb +134 -0
  35. data/lib/bundler/templates/Executable +16 -0
  36. data/lib/bundler/templates/Gemfile +4 -0
  37. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  38. data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
  39. data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
  40. data/lib/bundler/templates/newgem/gitignore.tt +4 -0
  41. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -0
  42. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  43. data/lib/bundler/templates/newgem/newgem.gemspec.tt +21 -0
  44. data/lib/bundler/ui.rb +73 -0
  45. data/lib/bundler/vendor/net/http/faster.rb +27 -0
  46. data/lib/bundler/vendor/net/http/persistent.rb +464 -0
  47. data/lib/bundler/vendor/thor.rb +319 -0
  48. data/lib/bundler/vendor/thor/actions.rb +297 -0
  49. data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
  50. data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
  51. data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
  52. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +229 -0
  53. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +104 -0
  54. data/lib/bundler/vendor/thor/base.rb +556 -0
  55. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
  56. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  57. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
  58. data/lib/bundler/vendor/thor/error.rb +30 -0
  59. data/lib/bundler/vendor/thor/invocation.rb +168 -0
  60. data/lib/bundler/vendor/thor/parser.rb +4 -0
  61. data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
  62. data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
  63. data/lib/bundler/vendor/thor/parser/option.rb +120 -0
  64. data/lib/bundler/vendor/thor/parser/options.rb +174 -0
  65. data/lib/bundler/vendor/thor/shell.rb +88 -0
  66. data/lib/bundler/vendor/thor/shell/basic.rb +275 -0
  67. data/lib/bundler/vendor/thor/shell/color.rb +108 -0
  68. data/lib/bundler/vendor/thor/shell/html.rb +121 -0
  69. data/lib/bundler/vendor/thor/task.rb +114 -0
  70. data/lib/bundler/vendor/thor/util.rb +229 -0
  71. data/lib/bundler/vendor/thor/version.rb +3 -0
  72. data/lib/bundler/version.rb +6 -0
  73. data/lib/bundler/vlad.rb +9 -0
  74. data/man/bundle-config.ronn +90 -0
  75. data/man/bundle-exec.ronn +111 -0
  76. data/man/bundle-install.ronn +314 -0
  77. data/man/bundle-package.ronn +59 -0
  78. data/man/bundle-update.ronn +176 -0
  79. data/man/bundle.ronn +80 -0
  80. data/man/gemfile.5.ronn +279 -0
  81. data/man/index.txt +6 -0
  82. data/spec/cache/gems_spec.rb +219 -0
  83. data/spec/cache/git_spec.rb +9 -0
  84. data/spec/cache/path_spec.rb +27 -0
  85. data/spec/cache/platform_spec.rb +57 -0
  86. data/spec/install/deploy_spec.rb +197 -0
  87. data/spec/install/deprecated_spec.rb +37 -0
  88. data/spec/install/gems/c_ext_spec.rb +48 -0
  89. data/spec/install/gems/dependency_api_spec.rb +85 -0
  90. data/spec/install/gems/env_spec.rb +107 -0
  91. data/spec/install/gems/flex_spec.rb +313 -0
  92. data/spec/install/gems/groups_spec.rb +245 -0
  93. data/spec/install/gems/packed_spec.rb +84 -0
  94. data/spec/install/gems/platform_spec.rb +208 -0
  95. data/spec/install/gems/resolving_spec.rb +72 -0
  96. data/spec/install/gems/simple_case_spec.rb +715 -0
  97. data/spec/install/gems/standalone_spec.rb +162 -0
  98. data/spec/install/gems/sudo_spec.rb +73 -0
  99. data/spec/install/gems/win32_spec.rb +26 -0
  100. data/spec/install/gemspec_spec.rb +108 -0
  101. data/spec/install/git_spec.rb +571 -0
  102. data/spec/install/invalid_spec.rb +17 -0
  103. data/spec/install/path_spec.rb +353 -0
  104. data/spec/install/upgrade_spec.rb +26 -0
  105. data/spec/lock/git_spec.rb +35 -0
  106. data/spec/lock/lockfile_spec.rb +683 -0
  107. data/spec/other/check_spec.rb +221 -0
  108. data/spec/other/clean_spec.rb +202 -0
  109. data/spec/other/config_spec.rb +40 -0
  110. data/spec/other/console_spec.rb +54 -0
  111. data/spec/other/exec_spec.rb +241 -0
  112. data/spec/other/ext_spec.rb +16 -0
  113. data/spec/other/gem_helper_spec.rb +128 -0
  114. data/spec/other/help_spec.rb +38 -0
  115. data/spec/other/init_spec.rb +40 -0
  116. data/spec/other/newgem_spec.rb +24 -0
  117. data/spec/other/open_spec.rb +35 -0
  118. data/spec/other/show_spec.rb +82 -0
  119. data/spec/pack/gems_spec.rb +54 -0
  120. data/spec/quality_spec.rb +58 -0
  121. data/spec/resolver/basic_spec.rb +20 -0
  122. data/spec/resolver/platform_spec.rb +82 -0
  123. data/spec/runtime/executable_spec.rb +110 -0
  124. data/spec/runtime/load_spec.rb +107 -0
  125. data/spec/runtime/platform_spec.rb +90 -0
  126. data/spec/runtime/require_spec.rb +231 -0
  127. data/spec/runtime/setup_spec.rb +688 -0
  128. data/spec/runtime/with_clean_env_spec.rb +15 -0
  129. data/spec/spec_helper.rb +85 -0
  130. data/spec/support/artifice/endpoint.rb +50 -0
  131. data/spec/support/artifice/endpoint_fallback.rb +22 -0
  132. data/spec/support/artifice/endpoint_marshal_fail.rb +11 -0
  133. data/spec/support/artifice/endpoint_redirect.rb +11 -0
  134. data/spec/support/builders.rb +574 -0
  135. data/spec/support/fakeweb/rack-1.0.0.marshal +2 -0
  136. data/spec/support/fakeweb/windows.rb +23 -0
  137. data/spec/support/helpers.rb +246 -0
  138. data/spec/support/indexes.rb +112 -0
  139. data/spec/support/matchers.rb +89 -0
  140. data/spec/support/path.rb +73 -0
  141. data/spec/support/platforms.rb +53 -0
  142. data/spec/support/ruby_ext.rb +20 -0
  143. data/spec/support/rubygems_ext.rb +35 -0
  144. data/spec/support/rubygems_hax/platform.rb +11 -0
  145. data/spec/support/sudo.rb +21 -0
  146. data/spec/update/gems_spec.rb +121 -0
  147. data/spec/update/git_spec.rb +196 -0
  148. data/spec/update/source_spec.rb +51 -0
  149. metadata +294 -0
@@ -0,0 +1,40 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle init" do
4
+ it "generates a Gemfile" do
5
+ bundle :init
6
+ bundled_app("Gemfile").should exist
7
+ end
8
+
9
+ it "does not change existing Gemfiles" do
10
+ gemfile <<-G
11
+ gem "rails"
12
+ G
13
+
14
+ lambda {
15
+ bundle :init
16
+ }.should_not change { File.read(bundled_app("Gemfile")) }
17
+ end
18
+
19
+ it "should generate from an existing gemspec" do
20
+ spec_file = tmp.join('test.gemspec')
21
+ File.open(spec_file, 'w') do |file|
22
+ file << <<-S
23
+ Gem::Specification.new do |s|
24
+ s.name = 'test'
25
+ s.add_dependency 'rack', '= 1.0.1'
26
+ s.add_development_dependency 'rspec', '1.2'
27
+ end
28
+ S
29
+ end
30
+
31
+ bundle :init, :gemspec => spec_file
32
+
33
+ gemfile = bundled_app("Gemfile").read
34
+ gemfile.should =~ /source :gemcutter/
35
+ check gemfile.scan(/gem "rack", "= 1.0.1"/).size.should == 1
36
+ check gemfile.scan(/gem "rspec", "= 1.2"/).size.should == 1
37
+ check gemfile.scan(/group :development/).size.should == 1
38
+ end
39
+
40
+ end
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle gem" do
4
+ before :each do
5
+ bundle 'gem test-gem'
6
+ end
7
+
8
+ it "generates a gem skeleton" do
9
+ bundled_app("test-gem/test-gem.gemspec").should exist
10
+ bundled_app("test-gem/Gemfile").should exist
11
+ bundled_app("test-gem/Rakefile").should exist
12
+ bundled_app("test-gem/lib/test-gem.rb").should exist
13
+ bundled_app("test-gem/lib/test-gem/version.rb").should exist
14
+ end
15
+
16
+ it "starts with version 0.0.1" do
17
+ bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /VERSION = "0.0.1"/
18
+ end
19
+
20
+ it "nests constants so they work" do
21
+ bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /module Test\n module Gem/
22
+ bundled_app("test-gem/lib/test-gem.rb").read.should =~ /module Test\n module Gem/
23
+ end
24
+ end
@@ -0,0 +1,35 @@
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
+ out.should == "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
+ out.should == "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
+ out.should == "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
+ out.should == "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
+ out.should match(/could not find gem 'missing'/i)
34
+ end
35
+ end
@@ -0,0 +1,82 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle show" do
4
+ before :each do
5
+ install_gemfile <<-G
6
+ source "file://#{gem_repo1}"
7
+ gem "rails"
8
+ G
9
+ end
10
+
11
+ it "creates a Gemfile.lock if one did not exist" do
12
+ FileUtils.rm("Gemfile.lock")
13
+
14
+ bundle "show"
15
+
16
+ bundled_app("Gemfile.lock").should exist
17
+ end
18
+
19
+ it "creates a Gemfile.lock if one did not exist and we're doing bundle show rails" do
20
+ FileUtils.rm("Gemfile.lock")
21
+
22
+ bundle "show rails"
23
+
24
+ bundled_app("Gemfile.lock").should exist
25
+ end
26
+
27
+ it "prints path if gem exists in bundle" do
28
+ bundle "show rails"
29
+ out.should == default_bundle_path('gems', 'rails-2.3.2').to_s
30
+ end
31
+
32
+ it "prints the path to the running bundler" do
33
+ bundle "show bundler"
34
+ out.should == File.expand_path('../../../', __FILE__)
35
+ end
36
+
37
+ it "complains if gem not in bundle" do
38
+ bundle "show missing"
39
+ out.should =~ /could not find gem 'missing'/i
40
+ end
41
+ end
42
+
43
+ describe "bundle show with a git repo" do
44
+ before :each do
45
+ @git = build_git "foo", "1.0"
46
+ end
47
+
48
+ it "prints out git info" do
49
+ install_gemfile <<-G
50
+ gem "foo", :git => "#{lib_path('foo-1.0')}"
51
+ G
52
+ should_be_installed "foo 1.0"
53
+
54
+ bundle :show
55
+ out.should include("foo (1.0 #{@git.ref_for('master', 6)}")
56
+ end
57
+
58
+ it "prints out branch names other than master" do
59
+ update_git "foo", :branch => "omg" do |s|
60
+ s.write "lib/foo.rb", "FOO = '1.0.omg'"
61
+ end
62
+ @revision = revision_for(lib_path("foo-1.0"))[0...6]
63
+
64
+ install_gemfile <<-G
65
+ gem "foo", :git => "#{lib_path('foo-1.0')}", :branch => "omg"
66
+ G
67
+ should_be_installed "foo 1.0.omg"
68
+
69
+ bundle :show
70
+ out.should include("foo (1.0 #{@git.ref_for('omg', 6)}")
71
+ end
72
+
73
+ it "doesn't print the branch when tied to a ref" do
74
+ sha = revision_for(lib_path("foo-1.0"))
75
+ install_gemfile <<-G
76
+ gem "foo", :git => "#{lib_path('foo-1.0')}", :ref => "#{sha}"
77
+ G
78
+
79
+ bundle :show
80
+ out.should include("foo (1.0 #{sha[0..6]})")
81
+ end
82
+ end
@@ -0,0 +1,54 @@
1
+ require "spec_helper"
2
+
3
+ describe "bundle pack with gems" do
4
+ describe "when there are only gemsources" do
5
+ before :each do
6
+ gemfile <<-G
7
+ gem 'rack'
8
+ G
9
+
10
+ system_gems "rack-1.0.0"
11
+ bundle :pack
12
+ end
13
+
14
+ it "locks the gemfile" do
15
+ bundled_app("Gemfile.lock").should exist
16
+ end
17
+
18
+ it "caches the gems" do
19
+ bundled_app("vendor/cache/rack-1.0.0.gem").should exist
20
+ end
21
+
22
+ describe "when there are any git sources" do
23
+ describe "when floating on master" do
24
+ before :each do
25
+ build_git "foo"
26
+
27
+ gemfile <<-G
28
+ source "file://#{gem_repo1}"
29
+ git "#{lib_path('foo-1.0')}" do
30
+ gem 'foo'
31
+ end
32
+ G
33
+
34
+ bundle :pack
35
+ end
36
+
37
+ fit "caches the repository" do
38
+ @source = Bundler::Source::Git.new "uri" => lib_path("foo-1.0")
39
+ bundled_app("vendor/cache/#{@source.send :cache_path_scope}").should exist
40
+ end
41
+ end
42
+
43
+ describe "when given a ref" do
44
+ =begin TODO
45
+ before(:each) do
46
+ build_git "foo"
47
+ @revision = revision_for(lib_path("foo-1.0"))
48
+ update_git "foo"
49
+ end
50
+ =end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,58 @@
1
+ require "spec_helper"
2
+
3
+ describe "The library itself" do
4
+ def check_for_tab_characters(filename)
5
+ failing_lines = []
6
+ File.readlines(filename).each_with_index do |line,number|
7
+ failing_lines << number + 1 if line =~ /\t/
8
+ end
9
+
10
+ unless failing_lines.empty?
11
+ "#{filename} has tab characters on lines #{failing_lines.join(', ')}"
12
+ end
13
+ end
14
+
15
+ def check_for_extra_spaces(filename)
16
+ failing_lines = []
17
+ File.readlines(filename).each_with_index do |line,number|
18
+ next if line =~ /^\s+#.*\s+\n$/
19
+ failing_lines << number + 1 if line =~ /\s+\n$/
20
+ end
21
+
22
+ unless failing_lines.empty?
23
+ "#{filename} has spaces on the EOL on lines #{failing_lines.join(', ')}"
24
+ end
25
+ end
26
+
27
+ RSpec::Matchers.define :be_well_formed do
28
+ failure_message_for_should do |actual|
29
+ actual.join("\n")
30
+ end
31
+
32
+ match do |actual|
33
+ actual.empty?
34
+ end
35
+ end
36
+
37
+ it "has no malformed whitespace" do
38
+ error_messages = []
39
+ Dir.chdir(File.expand_path("../..", __FILE__)) do
40
+ `git ls-files`.split("\n").each do |filename|
41
+ next if filename =~ /\.gitmodules|\.marshal|fixtures|vendor/
42
+ error_messages << check_for_tab_characters(filename)
43
+ error_messages << check_for_extra_spaces(filename)
44
+ end
45
+ end
46
+ error_messages.compact.should be_well_formed
47
+ end
48
+
49
+ it "can still be built" do
50
+ Dir.chdir(root) do
51
+ `gem build bundler.gemspec`
52
+ check $?.should == 0
53
+
54
+ # clean up the .gem generated
55
+ system("rm bundler-#{Bundler::VERSION}.gem")
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,20 @@
1
+ require "spec_helper"
2
+
3
+ describe "Resolving" do
4
+
5
+ before :each do
6
+ @index = an_awesome_index
7
+ end
8
+
9
+ it "resolves a single gem" do
10
+ dep "rack"
11
+
12
+ should_resolve_as %w(rack-1.1)
13
+ end
14
+
15
+ it "resolves a gem with dependencies" do
16
+ dep "actionpack"
17
+
18
+ should_resolve_as %w(actionpack-2.3.5 activesupport-2.3.5 rack-1.0)
19
+ end
20
+ end
@@ -0,0 +1,82 @@
1
+ require "spec_helper"
2
+
3
+ describe "Resolving platform craziness" do
4
+ describe "with cross-platform gems" do
5
+ before :each do
6
+ @index = an_awesome_index
7
+ end
8
+
9
+ it "resolves a simple multi platform gem" do
10
+ dep "nokogiri"
11
+ platforms "ruby", "java"
12
+
13
+ should_resolve_as %w(nokogiri-1.4.2 nokogiri-1.4.2-java weakling-0.0.3)
14
+ end
15
+
16
+ it "doesn't pull gems that don't exist for the current platform" do
17
+ dep "nokogiri"
18
+ platforms "ruby"
19
+
20
+ should_resolve_as %w(nokogiri-1.4.2)
21
+ end
22
+
23
+ it "doesn't pull gems when the version is available for all requested platforms" do
24
+ dep "nokogiri"
25
+ platforms "mswin32"
26
+
27
+ should_resolve_as %w(nokogiri-1.4.2.1-x86-mswin32)
28
+ end
29
+ end
30
+
31
+ describe "with mingw32" do
32
+
33
+ before :each do
34
+ @index = build_index do
35
+ platforms "mingw32 mswin32" do |platform|
36
+ gem "thin", "1.2.7", platform
37
+ end
38
+ end
39
+ end
40
+
41
+ it "finds mswin gems" do
42
+ # win32 is hardcoded to get CPU x86 in rubygems
43
+ platforms "mswin32"
44
+ dep "thin"
45
+ should_resolve_as %w(thin-1.2.7-x86-mswin32)
46
+ end
47
+
48
+ it "finds mingw gems" do
49
+ # mingw is _not_ hardcoded to add CPU x86 in rubygems
50
+ platforms "x86-mingw32"
51
+ dep "thin"
52
+ should_resolve_as %w(thin-1.2.7-x86-mingw32)
53
+ end
54
+ end
55
+
56
+ describe "with conflicting cases" do
57
+ before :each do
58
+ @index = build_index do
59
+ gem "foo", "1.0.0" do
60
+ dep "bar", ">= 0"
61
+ end
62
+
63
+ gem 'bar', "1.0.0" do
64
+ dep "baz", "~> 1.0.0"
65
+ end
66
+
67
+ gem "bar", "1.0.0", "java" do
68
+ dep "baz", " ~> 1.1.0"
69
+ end
70
+
71
+ gem "baz", %w(1.0.0 1.1.0 1.2.0)
72
+ end
73
+ end
74
+
75
+ it "reports on the conflict" do
76
+ platforms "ruby", "java"
77
+ dep "foo"
78
+
79
+ should_conflict_on "baz"
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,110 @@
1
+ require "spec_helper"
2
+
3
+ describe "Running bin/* commands" do
4
+ before :each do
5
+ gemfile <<-G
6
+ source "file://#{gem_repo1}"
7
+ gem "rack"
8
+ G
9
+ end
10
+
11
+ it "runs the bundled command when in the bundle" do
12
+ bundle "install --binstubs"
13
+
14
+ build_gem "rack", "2.0", :to_system => true do |s|
15
+ s.executables = "rackup"
16
+ end
17
+
18
+ gembin "rackup"
19
+ out.should == "1.0.0"
20
+ end
21
+
22
+ it "allows the location of the gem stubs to be specified" do
23
+ bundle "install --binstubs gbin"
24
+
25
+ bundled_app("bin").should_not exist
26
+ bundled_app("gbin/rackup").should exist
27
+
28
+ gembin bundled_app("gbin/rackup")
29
+ out.should == "1.0.0"
30
+ end
31
+
32
+ it "allows absolute paths as a specification of where to install bin stubs" do
33
+ bundle "install --binstubs #{tmp}/bin"
34
+
35
+ gembin tmp("bin/rackup")
36
+ out.should == "1.0.0"
37
+ end
38
+
39
+ it "runs the bundled command when out of the bundle" do
40
+ bundle "install --binstubs"
41
+
42
+ build_gem "rack", "2.0", :to_system => true do |s|
43
+ s.executables = "rackup"
44
+ end
45
+
46
+ Dir.chdir(tmp) do
47
+ gembin "rackup"
48
+ out.should == "1.0.0"
49
+ end
50
+ end
51
+
52
+ it "works with gems in path" do
53
+ build_lib "rack", :path => lib_path("rack") do |s|
54
+ s.executables = 'rackup'
55
+ end
56
+
57
+ gemfile <<-G
58
+ gem "rack", :path => "#{lib_path('rack')}"
59
+ G
60
+
61
+ bundle "install --binstubs"
62
+
63
+ build_gem 'rack', '2.0', :to_system => true do |s|
64
+ s.executables = 'rackup'
65
+ end
66
+
67
+ gembin "rackup"
68
+ out.should == '1.0'
69
+ end
70
+
71
+ it "don't bundle da bundla" do
72
+ build_gem "bundler", Bundler::VERSION, :to_system => true do |s|
73
+ s.executables = "bundle"
74
+ end
75
+
76
+ gemfile <<-G
77
+ source "file://#{gem_repo1}"
78
+ gem "bundler"
79
+ G
80
+
81
+ bundle "install --binstubs"
82
+
83
+ bundled_app("bin/bundle").should_not exist
84
+ end
85
+
86
+ it "does not generate bin stubs if the option was not specified" do
87
+ bundle "install"
88
+
89
+ bundled_app("bin/rackup").should_not exist
90
+ end
91
+
92
+ it "remembers that the option was specified" do
93
+ gemfile <<-G
94
+ source "file://#{gem_repo1}"
95
+ gem "activesupport"
96
+ G
97
+
98
+ bundle "install --binstubs"
99
+
100
+ gemfile <<-G
101
+ source "file://#{gem_repo1}"
102
+ gem "activesupport"
103
+ gem "rack"
104
+ G
105
+
106
+ bundle "install"
107
+
108
+ bundled_app("bin/rackup").should exist
109
+ end
110
+ end