bundler 1.0.22 → 1.1.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/CHANGELOG.md +15 -181
- data/ISSUES.md +11 -26
- data/LICENSE +0 -2
- data/Rakefile +67 -116
- data/UPGRADING.md +4 -4
- data/bin/bundle +10 -10
- data/bundler.gemspec +5 -5
- data/lib/bundler.rb +15 -25
- data/lib/bundler/capistrano.rb +2 -2
- data/lib/bundler/cli.rb +41 -72
- data/lib/bundler/definition.rb +11 -37
- data/lib/bundler/dependency.rb +9 -13
- data/lib/bundler/deployment.rb +3 -8
- data/lib/bundler/dsl.rb +10 -24
- data/lib/bundler/fetcher.rb +101 -0
- data/lib/bundler/gem_helper.rb +6 -11
- data/lib/bundler/index.rb +8 -15
- data/lib/bundler/installer.rb +55 -35
- data/lib/bundler/lazy_specification.rb +7 -10
- data/lib/bundler/remote_specification.rb +6 -8
- data/lib/bundler/resolver.rb +18 -12
- data/lib/bundler/rubygems_ext.rb +3 -20
- data/lib/bundler/runtime.rb +57 -8
- data/lib/bundler/settings.rb +6 -4
- data/lib/bundler/setup.rb +5 -12
- data/lib/bundler/shared_helpers.rb +100 -4
- data/lib/bundler/source.rb +61 -106
- data/lib/bundler/spec_set.rb +8 -9
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -1
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +0 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -6
- data/lib/bundler/ui.rb +1 -4
- data/lib/bundler/vendor/net/http/faster.rb +27 -0
- data/lib/bundler/vendor/net/http/persistent.rb +464 -0
- data/lib/bundler/vendor/thor.rb +4 -43
- data/lib/bundler/vendor/thor/actions.rb +11 -28
- data/lib/bundler/vendor/thor/actions/create_file.rb +2 -2
- data/lib/bundler/vendor/thor/actions/directory.rb +2 -2
- data/lib/bundler/vendor/thor/actions/empty_directory.rb +0 -0
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +15 -56
- data/lib/bundler/vendor/thor/actions/inject_into_file.rb +10 -15
- data/lib/bundler/vendor/thor/base.rb +4 -24
- data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +0 -0
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +0 -0
- data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +0 -0
- data/lib/bundler/vendor/thor/error.rb +0 -0
- data/lib/bundler/vendor/thor/invocation.rb +0 -0
- data/lib/bundler/vendor/thor/parser.rb +0 -0
- data/lib/bundler/vendor/thor/parser/argument.rb +0 -0
- data/lib/bundler/vendor/thor/parser/arguments.rb +2 -2
- data/lib/bundler/vendor/thor/parser/option.rb +1 -1
- data/lib/bundler/vendor/thor/parser/options.rb +16 -17
- data/lib/bundler/vendor/thor/shell.rb +0 -0
- data/lib/bundler/vendor/thor/shell/basic.rb +13 -40
- data/lib/bundler/vendor/thor/shell/color.rb +0 -0
- data/lib/bundler/vendor/thor/task.rb +4 -3
- data/lib/bundler/vendor/thor/util.rb +2 -2
- data/lib/bundler/vendor/thor/version.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +0 -2
- data/man/bundle-install.ronn +3 -6
- data/man/gemfile.5.ronn +2 -7
- data/spec/cache/gems_spec.rb +0 -11
- data/spec/cache/git_spec.rb +2 -5
- data/spec/install/deploy_spec.rb +8 -8
- data/spec/install/gems/dependency_api_spec.rb +85 -0
- data/spec/install/gems/flex_spec.rb +4 -4
- data/spec/install/gems/groups_spec.rb +3 -17
- data/spec/install/gems/platform_spec.rb +16 -0
- data/spec/install/gems/simple_case_spec.rb +24 -88
- data/spec/install/gems/standalone_spec.rb +162 -0
- data/spec/install/gems/sudo_spec.rb +2 -3
- data/spec/install/gemspec_spec.rb +0 -38
- data/spec/install/git_spec.rb +4 -3
- data/spec/install/invalid_spec.rb +0 -18
- data/spec/install/path_spec.rb +1 -53
- data/spec/lock/git_spec.rb +1 -1
- data/spec/lock/lockfile_spec.rb +16 -72
- data/spec/other/check_spec.rb +6 -6
- data/spec/other/clean_spec.rb +202 -0
- data/spec/other/exec_spec.rb +7 -14
- data/spec/other/ext_spec.rb +0 -21
- data/spec/{bundler → other}/gem_helper_spec.rb +1 -16
- data/spec/other/help_spec.rb +1 -2
- data/spec/other/init_spec.rb +3 -3
- data/spec/other/newgem_spec.rb +1 -23
- data/spec/pack/gems_spec.rb +22 -0
- data/spec/quality_spec.rb +2 -6
- data/spec/runtime/require_spec.rb +10 -10
- data/spec/runtime/setup_spec.rb +12 -54
- data/spec/spec_helper.rb +7 -14
- data/spec/support/artifice/endpoint.rb +50 -0
- data/spec/support/artifice/endpoint_fallback.rb +22 -0
- data/spec/support/artifice/endpoint_marshal_fail.rb +11 -0
- data/spec/support/artifice/endpoint_redirect.rb +11 -0
- data/spec/support/builders.rb +2 -25
- data/spec/support/fakeweb/rack-1.0.0.marshal +2 -0
- data/spec/support/fakeweb/windows.rb +23 -0
- data/spec/support/helpers.rb +12 -5
- data/spec/support/matchers.rb +16 -4
- data/spec/support/path.rb +2 -0
- data/spec/support/rubygems_ext.rb +2 -6
- data/spec/update/gems_spec.rb +2 -3
- data/spec/update/git_spec.rb +2 -2
- metadata +41 -24
- data/.travis.yml +0 -31
- data/lib/bundler/gem_installer.rb +0 -9
- data/lib/bundler/gem_tasks.rb +0 -2
- data/lib/bundler/rubygems_integration.rb +0 -344
- data/lib/bundler/vendor/thor/actions/create_link.rb +0 -57
- data/lib/bundler/vendor/thor/group.rb +0 -273
- data/lib/bundler/vendor/thor/rake_compat.rb +0 -66
- data/lib/bundler/vendor/thor/runner.rb +0 -309
- data/lib/bundler/vendored_thor.rb +0 -7
data/spec/other/exec_spec.rb
CHANGED
@@ -33,12 +33,6 @@ describe "bundle exec" do
|
|
33
33
|
out.should == "1.0.0"
|
34
34
|
end
|
35
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
36
|
it "handles different versions in different bundles" do
|
43
37
|
build_repo2 do
|
44
38
|
build_gem "rack_two", "1.0.0" do |s|
|
@@ -60,7 +54,7 @@ describe "bundle exec" do
|
|
60
54
|
|
61
55
|
bundle "exec rackup"
|
62
56
|
|
63
|
-
out.should
|
57
|
+
check out.should == "0.9.1"
|
64
58
|
|
65
59
|
Dir.chdir bundled_app2 do
|
66
60
|
bundle "exec rackup"
|
@@ -80,7 +74,7 @@ describe "bundle exec" do
|
|
80
74
|
|
81
75
|
bundle "exec rackup"
|
82
76
|
|
83
|
-
out.should
|
77
|
+
check out.should == "0.9.1"
|
84
78
|
should_not_be_installed "rack_middleware 1.0"
|
85
79
|
end
|
86
80
|
|
@@ -89,8 +83,7 @@ describe "bundle exec" do
|
|
89
83
|
gem "rack"
|
90
84
|
G
|
91
85
|
|
92
|
-
rubyopt =
|
93
|
-
rubyopt = "-I#{bundler_path} -rbundler/setup #{rubyopt}"
|
86
|
+
rubyopt = "-I#{bundler_path} -rbundler/setup"
|
94
87
|
|
95
88
|
bundle "exec 'echo $RUBYOPT'"
|
96
89
|
out.should have_rubyopts(rubyopt)
|
@@ -105,9 +98,9 @@ describe "bundle exec" do
|
|
105
98
|
G
|
106
99
|
|
107
100
|
bundle "exec foobarbaz", :exitstatus => true
|
108
|
-
exitstatus.should
|
101
|
+
check exitstatus.should == 127
|
109
102
|
out.should include("bundler: command not found: foobarbaz")
|
110
|
-
out.should include("Install missing gem
|
103
|
+
out.should include("Install missing gem binaries with `bundle install`")
|
111
104
|
end
|
112
105
|
|
113
106
|
it "errors nicely when the argument is not executable" do
|
@@ -117,11 +110,11 @@ describe "bundle exec" do
|
|
117
110
|
|
118
111
|
bundle "exec touch foo"
|
119
112
|
bundle "exec ./foo", :exitstatus => true
|
120
|
-
exitstatus.should
|
113
|
+
check exitstatus.should == 126
|
121
114
|
out.should include("bundler: not executable: ./foo")
|
122
115
|
end
|
123
116
|
|
124
|
-
describe "with gem
|
117
|
+
describe "with gem binaries" do
|
125
118
|
describe "run from a random directory" do
|
126
119
|
before(:each) do
|
127
120
|
install_gemfile <<-G
|
data/spec/other/ext_spec.rb
CHANGED
@@ -14,24 +14,3 @@ describe "Bundler::GemHelpers#generic" do
|
|
14
14
|
generic(pl('x86-darwin-10')).should == pl('ruby')
|
15
15
|
end
|
16
16
|
end
|
17
|
-
|
18
|
-
describe "Gem::SourceIndex#refresh!" do
|
19
|
-
rubygems_1_7 = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.7.0")
|
20
|
-
|
21
|
-
before do
|
22
|
-
install_gemfile <<-G
|
23
|
-
source "file://#{gem_repo1}"
|
24
|
-
gem "rack"
|
25
|
-
G
|
26
|
-
end
|
27
|
-
|
28
|
-
it "does not explode when called", :if => rubygems_1_7 do
|
29
|
-
run "Gem.source_index.refresh!"
|
30
|
-
run "Gem::SourceIndex.new([]).refresh!"
|
31
|
-
end
|
32
|
-
|
33
|
-
it "does not explode when called", :unless => rubygems_1_7 do
|
34
|
-
run "Gem.source_index.refresh!"
|
35
|
-
run "Gem::SourceIndex.from_gems_in([]).refresh!"
|
36
|
-
end
|
37
|
-
end
|
@@ -10,14 +10,6 @@ describe "Bundler::GemHelper tasks" do
|
|
10
10
|
helper.gemspec.name.should == 'test'
|
11
11
|
end
|
12
12
|
|
13
|
-
it "interpolates the name for a hidden gemspec" do
|
14
|
-
bundle 'gem test'
|
15
|
-
app = bundled_app("test")
|
16
|
-
FileUtils.mv app.join('test.gemspec'), app.join('.gemspec')
|
17
|
-
helper = Bundler::GemHelper.new(app.to_s)
|
18
|
-
helper.gemspec.name.should == 'test'
|
19
|
-
end
|
20
|
-
|
21
13
|
it "should fail when there is no gemspec" do
|
22
14
|
bundle 'gem test'
|
23
15
|
app = bundled_app("test")
|
@@ -31,13 +23,6 @@ describe "Bundler::GemHelper tasks" do
|
|
31
23
|
File.open(File.join(app.to_s, 'test2.gemspec'), 'w') {|f| f << ''}
|
32
24
|
proc { Bundler::GemHelper.new(app.to_s) }.should raise_error(/Unable to determine name/)
|
33
25
|
end
|
34
|
-
|
35
|
-
it "handles namespaces and converting to CamelCase" do
|
36
|
-
bundle 'gem test-foo_bar'
|
37
|
-
lib = bundled_app('test-foo_bar').join('lib/test-foo_bar.rb').read
|
38
|
-
lib.should include("module Test")
|
39
|
-
lib.should include("module FooBar")
|
40
|
-
end
|
41
26
|
end
|
42
27
|
|
43
28
|
context "gem management" do
|
@@ -133,7 +118,7 @@ describe "Bundler::GemHelper tasks" do
|
|
133
118
|
`git config user.name "name"`
|
134
119
|
`git remote add origin file://#{gem_repo1}`
|
135
120
|
`git commit -a -m "initial commit"`
|
136
|
-
|
121
|
+
Open3.popen3("git push origin master") # use popen3 to silence output...
|
137
122
|
`git commit -a -m "another commit"`
|
138
123
|
}
|
139
124
|
@helper.release_gem
|
data/spec/other/help_spec.rb
CHANGED
@@ -7,8 +7,7 @@ describe "bundle help" do
|
|
7
7
|
system_gems "bundler-0.8.1"
|
8
8
|
|
9
9
|
bundle "help", :expect_err => true
|
10
|
-
err.should
|
11
|
-
err.should include("This can be done by running `gem cleanup bundler`.")
|
10
|
+
err.should == "Please remove older versions of bundler. This can be done by running `gem cleanup bundler`."
|
12
11
|
end
|
13
12
|
|
14
13
|
it "uses groff when available" do
|
data/spec/other/init_spec.rb
CHANGED
@@ -32,9 +32,9 @@ describe "bundle init" do
|
|
32
32
|
|
33
33
|
gemfile = bundled_app("Gemfile").read
|
34
34
|
gemfile.should =~ /source :gemcutter/
|
35
|
-
gemfile.scan(/gem "rack", "= 1.0.1"/).size.should
|
36
|
-
gemfile.scan(/gem "rspec", "= 1.2"/).size.should
|
37
|
-
gemfile.scan(/group :development/).size.should
|
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
38
|
end
|
39
39
|
|
40
40
|
end
|
data/spec/other/newgem_spec.rb
CHANGED
@@ -21,26 +21,4 @@ describe "bundle gem" do
|
|
21
21
|
bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /module Test\n module Gem/
|
22
22
|
bundled_app("test-gem/lib/test-gem.rb").read.should =~ /module Test\n module Gem/
|
23
23
|
end
|
24
|
-
|
25
|
-
it "requires the version file" do
|
26
|
-
bundled_app("test-gem/lib/test-gem.rb").read.should =~ /require "test-gem\/version"/
|
27
|
-
end
|
28
|
-
|
29
|
-
it "runs rake without problems" do
|
30
|
-
system_gems ["rake-0.8.7"]
|
31
|
-
|
32
|
-
rakefile = <<-RAKEFILE
|
33
|
-
task :default do
|
34
|
-
puts 'SUCCESS'
|
35
|
-
end
|
36
|
-
RAKEFILE
|
37
|
-
File.open(bundled_app("test-gem/Rakefile"), 'w') do |file|
|
38
|
-
file.puts rakefile
|
39
|
-
end
|
40
|
-
|
41
|
-
Dir.chdir(bundled_app("test-gem")) do
|
42
|
-
sys_exec("rake")
|
43
|
-
out.should include("SUCCESS")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
24
|
+
end
|
@@ -0,0 +1,22 @@
|
|
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
|
+
end
|
22
|
+
end
|
data/spec/quality_spec.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
if defined?(Encoding)
|
4
|
-
Encoding.default_external = "UTF-8"
|
5
|
-
end
|
6
|
-
|
7
3
|
describe "The library itself" do
|
8
4
|
def check_for_tab_characters(filename)
|
9
5
|
failing_lines = []
|
@@ -42,7 +38,7 @@ describe "The library itself" do
|
|
42
38
|
error_messages = []
|
43
39
|
Dir.chdir(File.expand_path("../..", __FILE__)) do
|
44
40
|
`git ls-files`.split("\n").each do |filename|
|
45
|
-
next if filename =~ /\.gitmodules|fixtures/
|
41
|
+
next if filename =~ /\.gitmodules|\.marshal|fixtures|vendor/
|
46
42
|
error_messages << check_for_tab_characters(filename)
|
47
43
|
error_messages << check_for_extra_spaces(filename)
|
48
44
|
end
|
@@ -53,7 +49,7 @@ describe "The library itself" do
|
|
53
49
|
it "can still be built" do
|
54
50
|
Dir.chdir(root) do
|
55
51
|
`gem build bundler.gemspec`
|
56
|
-
$?.should
|
52
|
+
check $?.should == 0
|
57
53
|
|
58
54
|
# clean up the .gem generated
|
59
55
|
system("rm bundler-#{Bundler::VERSION}.gem")
|
@@ -48,23 +48,23 @@ describe "Bundler.require" do
|
|
48
48
|
it "requires the gems" do
|
49
49
|
# default group
|
50
50
|
run "Bundler.require"
|
51
|
-
out.should
|
51
|
+
check out.should == "two"
|
52
52
|
|
53
53
|
# specific group
|
54
54
|
run "Bundler.require(:bar)"
|
55
|
-
out.should
|
55
|
+
check out.should == "baz\nqux"
|
56
56
|
|
57
57
|
# default and specific group
|
58
58
|
run "Bundler.require(:default, :bar)"
|
59
|
-
out.should
|
59
|
+
check out.should == "baz\nqux\ntwo"
|
60
60
|
|
61
61
|
# specific group given as a string
|
62
62
|
run "Bundler.require('bar')"
|
63
|
-
out.should
|
63
|
+
check out.should == "baz\nqux"
|
64
64
|
|
65
65
|
# specific group declared as a string
|
66
66
|
run "Bundler.require(:string)"
|
67
|
-
out.should
|
67
|
+
check out.should == "six"
|
68
68
|
|
69
69
|
# required in resolver order instead of gemfile order
|
70
70
|
run("Bundler.require(:not)")
|
@@ -95,10 +95,10 @@ describe "Bundler.require" do
|
|
95
95
|
describe "using bundle exec" do
|
96
96
|
it "requires the locked gems" do
|
97
97
|
bundle "exec ruby -e 'Bundler.require'"
|
98
|
-
out.should
|
98
|
+
check out.should == "two"
|
99
99
|
|
100
100
|
bundle "exec ruby -e 'Bundler.require(:bar)'"
|
101
|
-
out.should
|
101
|
+
check out.should == "baz\nqux"
|
102
102
|
|
103
103
|
bundle "exec ruby -e 'Bundler.require(:default, :bar)'"
|
104
104
|
out.should == "baz\nqux\ntwo"
|
@@ -138,7 +138,7 @@ describe "Bundler.require" do
|
|
138
138
|
G
|
139
139
|
|
140
140
|
run "Bundler.require"
|
141
|
-
out.should
|
141
|
+
check out.should == "two\nmodule_two\none"
|
142
142
|
end
|
143
143
|
|
144
144
|
describe "a gem with different requires for different envs" do
|
@@ -178,7 +178,7 @@ describe "Bundler.require" do
|
|
178
178
|
G
|
179
179
|
|
180
180
|
run "Bundler.require"
|
181
|
-
out.should
|
181
|
+
check out.should == "two_not_loaded\none\ntwo"
|
182
182
|
end
|
183
183
|
|
184
184
|
describe "with busted gems" do
|
@@ -225,7 +225,7 @@ describe "Bundler.require with platform specific dependencies" do
|
|
225
225
|
|
226
226
|
run "Bundler.require; puts RACK", :expect_err => true
|
227
227
|
|
228
|
-
out.should
|
228
|
+
check out.should == "1.0.0"
|
229
229
|
err.should be_empty
|
230
230
|
end
|
231
231
|
end
|
data/spec/runtime/setup_spec.rb
CHANGED
@@ -16,8 +16,8 @@ describe "Bundler.setup" do
|
|
16
16
|
require 'rack'
|
17
17
|
puts RACK
|
18
18
|
RUBY
|
19
|
-
err.should
|
20
|
-
out.should
|
19
|
+
err.should == ""
|
20
|
+
out.should == "1.0.0"
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -25,7 +25,6 @@ describe "Bundler.setup" do
|
|
25
25
|
before(:each) do
|
26
26
|
install_gemfile <<-G
|
27
27
|
source "file://#{gem_repo1}"
|
28
|
-
gem "yard"
|
29
28
|
gem "rack", :group => :test
|
30
29
|
G
|
31
30
|
end
|
@@ -42,8 +41,8 @@ describe "Bundler.setup" do
|
|
42
41
|
puts "WIN"
|
43
42
|
end
|
44
43
|
RUBY
|
45
|
-
err.should
|
46
|
-
out.should
|
44
|
+
err.should == ""
|
45
|
+
out.should == "WIN"
|
47
46
|
end
|
48
47
|
|
49
48
|
it "leaves all groups available if they were already" do
|
@@ -56,26 +55,8 @@ describe "Bundler.setup" do
|
|
56
55
|
require 'rack'
|
57
56
|
puts RACK
|
58
57
|
RUBY
|
59
|
-
err.should
|
60
|
-
out.should
|
61
|
-
end
|
62
|
-
|
63
|
-
it "leaves :default available if setup is called twice" do
|
64
|
-
ruby <<-RUBY
|
65
|
-
require 'rubygems'
|
66
|
-
require 'bundler'
|
67
|
-
Bundler.setup(:default)
|
68
|
-
Bundler.setup(:default, :test)
|
69
|
-
|
70
|
-
begin
|
71
|
-
require 'yard'
|
72
|
-
puts "WIN"
|
73
|
-
rescue LoadError
|
74
|
-
puts "FAIL"
|
75
|
-
end
|
76
|
-
RUBY
|
77
|
-
err.should eq("")
|
78
|
-
out.should match("WIN")
|
58
|
+
err.should == ""
|
59
|
+
out.should == "1.0.0"
|
79
60
|
end
|
80
61
|
end
|
81
62
|
|
@@ -185,7 +166,7 @@ describe "Bundler.setup" do
|
|
185
166
|
should_be_installed "rack 1.0.0"
|
186
167
|
end
|
187
168
|
|
188
|
-
describe "
|
169
|
+
describe "crippling rubygems" do
|
189
170
|
describe "by replacing #gem" do
|
190
171
|
before :each do
|
191
172
|
install_gemfile <<-G
|
@@ -233,7 +214,7 @@ describe "Bundler.setup" do
|
|
233
214
|
out.should == "WIN"
|
234
215
|
end
|
235
216
|
|
236
|
-
it "version_requirement is now deprecated in
|
217
|
+
it "version_requirement is now deprecated in rubygesm 1.4.0+ when the version is wrong" do
|
237
218
|
run <<-R, :expect_err => true
|
238
219
|
begin
|
239
220
|
gem "rack", "1.0.0"
|
@@ -450,7 +431,7 @@ describe "Bundler.setup" do
|
|
450
431
|
end
|
451
432
|
R
|
452
433
|
|
453
|
-
out.should == "You have already activated thin 1.1, but your Gemfile requires thin 1.0.
|
434
|
+
out.should == "You have already activated thin 1.1, but your Gemfile requires thin 1.0. Consider using bundle exec."
|
454
435
|
end
|
455
436
|
|
456
437
|
it "version_requirement is now deprecated in rubygems 1.4.0+" do
|
@@ -541,34 +522,12 @@ describe "Bundler.setup" do
|
|
541
522
|
|
542
523
|
run <<-R
|
543
524
|
Gem.refresh
|
544
|
-
puts
|
525
|
+
puts Gem.source_index.find_name("rack").inspect
|
545
526
|
R
|
546
527
|
|
547
528
|
out.should == "[]"
|
548
529
|
end
|
549
530
|
|
550
|
-
describe "when a vendored gem specification uses the :path option" do
|
551
|
-
it "should resolve paths relative to the Gemfile" do
|
552
|
-
path = bundled_app(File.join('vendor', 'foo'))
|
553
|
-
build_lib "foo", :path => path
|
554
|
-
|
555
|
-
# If the .gemspec exists, then Bundler handles the path differently.
|
556
|
-
# See Source::Path.load_spec_files for details.
|
557
|
-
FileUtils.rm(File.join(path, 'foo.gemspec'))
|
558
|
-
|
559
|
-
install_gemfile <<-G
|
560
|
-
gem 'foo', '1.2.3', :path => 'vendor/foo'
|
561
|
-
G
|
562
|
-
|
563
|
-
Dir.chdir(bundled_app.parent) do
|
564
|
-
run <<-R, :env => {"BUNDLE_GEMFILE" => bundled_app('Gemfile')}
|
565
|
-
require 'foo'
|
566
|
-
R
|
567
|
-
end
|
568
|
-
err.should == ""
|
569
|
-
end
|
570
|
-
end
|
571
|
-
|
572
531
|
describe "with git gems that don't have gemspecs" do
|
573
532
|
before :each do
|
574
533
|
build_git "no-gemspec", :gemspec => false
|
@@ -711,8 +670,8 @@ describe "Bundler.setup" do
|
|
711
670
|
Bundler.load
|
712
671
|
RUBY
|
713
672
|
|
714
|
-
err.should
|
715
|
-
out.should
|
673
|
+
err.should == ""
|
674
|
+
out.should == ""
|
716
675
|
end
|
717
676
|
end
|
718
677
|
|
@@ -726,5 +685,4 @@ describe "Bundler.setup" do
|
|
726
685
|
err.should be_empty
|
727
686
|
end
|
728
687
|
end
|
729
|
-
|
730
688
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,6 @@
|
|
1
1
|
$:.unshift File.expand_path('..', __FILE__)
|
2
2
|
$:.unshift File.expand_path('../../lib', __FILE__)
|
3
3
|
|
4
|
-
begin
|
5
|
-
require 'psych'
|
6
|
-
rescue LoadError
|
7
|
-
ensure
|
8
|
-
require 'yaml'
|
9
|
-
end
|
10
|
-
|
11
4
|
require 'fileutils'
|
12
5
|
require 'rubygems'
|
13
6
|
require 'bundler'
|
@@ -25,7 +18,7 @@ else
|
|
25
18
|
end
|
26
19
|
|
27
20
|
Dir["#{File.expand_path('../support', __FILE__)}/*.rb"].each do |file|
|
28
|
-
require file
|
21
|
+
require file unless file =~ /fakeweb\/.*\.rb/
|
29
22
|
end
|
30
23
|
|
31
24
|
$debug = false
|
@@ -46,13 +39,8 @@ RSpec.configure do |config|
|
|
46
39
|
config.include Spec::Platforms
|
47
40
|
config.include Spec::Sudo
|
48
41
|
|
49
|
-
if Spec::Sudo.test_sudo?
|
50
|
-
config.filter_run :sudo => true
|
51
|
-
else
|
52
|
-
config.filter_run_excluding :sudo => true
|
53
|
-
end
|
54
|
-
|
55
42
|
config.filter_run :focused => true unless ENV['CI']
|
43
|
+
config.filter_run_excluding :sudo => true unless Spec::Sudo.test_sudo?
|
56
44
|
config.run_all_when_everything_filtered = true
|
57
45
|
config.alias_example_to :fit, :focused => true
|
58
46
|
|
@@ -64,6 +52,11 @@ RSpec.configure do |config|
|
|
64
52
|
pending "JRuby executables do not have a proper shebang" if RUBY_PLATFORM == "java"
|
65
53
|
end
|
66
54
|
|
55
|
+
def check(*args)
|
56
|
+
# suppresses ruby warnings about "useless use of == in void context"
|
57
|
+
# e.g. check foo.should == bar
|
58
|
+
end
|
59
|
+
|
67
60
|
config.before :all do
|
68
61
|
build_repo1
|
69
62
|
end
|