bundler 1.7.15 → 1.8.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +5 -14
- data/.rspec +1 -0
- data/.travis.yml +22 -15
- data/CHANGELOG.md +43 -13
- data/CODE_OF_CONDUCT.md +40 -0
- data/CONTRIBUTING.md +14 -12
- data/DEVELOPMENT.md +4 -2
- data/ISSUES.md +1 -1
- data/README.md +10 -14
- data/Rakefile +10 -10
- data/bin/bundle +1 -1
- data/bundler.gemspec +5 -4
- data/lib/bundler.rb +22 -3
- data/lib/bundler/anonymizable_uri.rb +24 -8
- data/lib/bundler/cli.rb +103 -66
- data/lib/bundler/cli/cache.rb +1 -0
- data/lib/bundler/cli/clean.rb +11 -4
- data/lib/bundler/cli/common.rb +2 -0
- data/lib/bundler/cli/console.rb +22 -26
- data/lib/bundler/cli/exec.rb +29 -22
- data/lib/bundler/cli/gem.rb +125 -37
- data/lib/bundler/cli/install.rb +22 -9
- data/lib/bundler/cli/outdated.rb +1 -1
- data/lib/bundler/cli/package.rb +8 -1
- data/lib/bundler/cli/show.rb +29 -3
- data/lib/bundler/cli/update.rb +2 -2
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/definition.rb +14 -22
- data/lib/bundler/dependency.rb +8 -1
- data/lib/bundler/dsl.rb +17 -4
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +44 -25
- data/lib/bundler/fetcher.rb +33 -25
- data/lib/bundler/friendly_errors.rb +38 -5
- data/lib/bundler/gem_helper.rb +16 -10
- data/lib/bundler/gem_helpers.rb +1 -0
- data/lib/bundler/graph.rb +4 -1
- data/lib/bundler/index.rb +15 -25
- data/lib/bundler/installer.rb +6 -6
- data/lib/bundler/lockfile_parser.rb +7 -7
- data/lib/bundler/resolver.rb +2 -1
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +1 -0
- data/lib/bundler/rubygems_integration.rb +1 -1
- data/lib/bundler/runtime.rb +22 -40
- data/lib/bundler/settings.rb +14 -5
- data/lib/bundler/setup.rb +2 -1
- data/lib/bundler/shared_helpers.rb +56 -4
- data/lib/bundler/source.rb +8 -9
- data/lib/bundler/source/git.rb +5 -1
- data/lib/bundler/source/git/git_proxy.rb +4 -0
- data/lib/bundler/source/path.rb +8 -11
- data/lib/bundler/source/path/installer.rb +0 -2
- data/lib/bundler/source/rubygems.rb +58 -72
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +13 -0
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +17 -18
- data/lib/bundler/templates/newgem/README.md.tt +9 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
- data/lib/bundler/templates/newgem/bin/console.tt +14 -0
- data/lib/bundler/templates/newgem/bin/setup.tt +7 -0
- data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/gitignore.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -13
- data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +1 -1
- data/lib/bundler/ui/shell.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +73 -0
- data/man/bundle-config.ronn +17 -15
- data/man/bundle-install.ronn +102 -93
- data/man/bundle-update.ronn +39 -30
- data/man/bundle.ronn +6 -0
- data/man/gemfile.5.ronn +74 -13
- metadata +10 -231
- data/lib/bundler/parallel_workers.rb +0 -18
- data/lib/bundler/parallel_workers/thread_worker.rb +0 -30
- data/lib/bundler/parallel_workers/unix_worker.rb +0 -101
- data/lib/bundler/parallel_workers/worker.rb +0 -69
- data/lib/bundler/templates/newgem/bin/newgem.tt +0 -3
- data/spec/bundler/anonymizable_uri_spec.rb +0 -32
- data/spec/bundler/bundler_spec.rb +0 -72
- data/spec/bundler/cli_spec.rb +0 -16
- data/spec/bundler/definition_spec.rb +0 -22
- data/spec/bundler/dsl_spec.rb +0 -82
- data/spec/bundler/friendly_errors_spec.rb +0 -13
- data/spec/bundler/gem_helper_spec.rb +0 -226
- data/spec/bundler/psyched_yaml_spec.rb +0 -8
- data/spec/bundler/retry_spec.rb +0 -59
- data/spec/bundler/settings_spec.rb +0 -13
- data/spec/bundler/source/rubygems_spec.rb +0 -25
- data/spec/bundler/source_list_spec.rb +0 -361
- data/spec/cache/gems_spec.rb +0 -284
- data/spec/cache/git_spec.rb +0 -188
- data/spec/cache/path_spec.rb +0 -121
- data/spec/cache/platform_spec.rb +0 -57
- data/spec/commands/binstubs_spec.rb +0 -219
- data/spec/commands/check_spec.rb +0 -278
- data/spec/commands/clean_spec.rb +0 -592
- data/spec/commands/config_spec.rb +0 -263
- data/spec/commands/console_spec.rb +0 -76
- data/spec/commands/exec_spec.rb +0 -309
- data/spec/commands/help_spec.rb +0 -39
- data/spec/commands/init_spec.rb +0 -39
- data/spec/commands/inject_spec.rb +0 -78
- data/spec/commands/licenses_spec.rb +0 -18
- data/spec/commands/newgem_spec.rb +0 -428
- data/spec/commands/open_spec.rb +0 -68
- data/spec/commands/outdated_spec.rb +0 -156
- data/spec/commands/package_spec.rb +0 -114
- data/spec/commands/show_spec.rb +0 -125
- data/spec/install/binstubs_spec.rb +0 -24
- data/spec/install/bundler_spec.rb +0 -146
- data/spec/install/deploy_spec.rb +0 -250
- data/spec/install/gemfile/gemspec_spec.rb +0 -170
- data/spec/install/gemfile/git_spec.rb +0 -967
- data/spec/install/gemfile/path_spec.rb +0 -500
- data/spec/install/gemfile_spec.rb +0 -44
- data/spec/install/gems/c_ext_spec.rb +0 -48
- data/spec/install/gems/dependency_api_spec.rb +0 -652
- data/spec/install/gems/env_spec.rb +0 -107
- data/spec/install/gems/flex_spec.rb +0 -314
- data/spec/install/gems/groups_spec.rb +0 -308
- data/spec/install/gems/mirror_spec.rb +0 -39
- data/spec/install/gems/platform_spec.rb +0 -195
- data/spec/install/gems/post_install_spec.rb +0 -121
- data/spec/install/gems/resolving_spec.rb +0 -124
- data/spec/install/gems/simple_case_spec.rb +0 -377
- data/spec/install/gems/sources_spec.rb +0 -386
- data/spec/install/gems/standalone_spec.rb +0 -260
- data/spec/install/gems/sudo_spec.rb +0 -136
- data/spec/install/gems/win32_spec.rb +0 -26
- data/spec/install/gemspecs_spec.rb +0 -50
- data/spec/install/path_spec.rb +0 -150
- data/spec/install/post_bundle_message_spec.rb +0 -142
- data/spec/install/prereleases_spec.rb +0 -43
- data/spec/install/security_policy_spec.rb +0 -77
- data/spec/install/upgrade_spec.rb +0 -26
- data/spec/lock/git_spec.rb +0 -34
- data/spec/lock/lockfile_spec.rb +0 -924
- data/spec/other/bundle_ruby_spec.rb +0 -142
- data/spec/other/cli_dispatch_spec.rb +0 -21
- data/spec/other/ext_spec.rb +0 -60
- data/spec/other/platform_spec.rb +0 -1285
- data/spec/other/ssl_cert_spec.rb +0 -23
- data/spec/quality_spec.rb +0 -88
- data/spec/realworld/dependency_api_spec.rb +0 -60
- data/spec/realworld/edgecases_spec.rb +0 -212
- data/spec/realworld/parallel_spec.rb +0 -71
- data/spec/resolver/basic_spec.rb +0 -66
- data/spec/resolver/platform_spec.rb +0 -88
- data/spec/runtime/executable_spec.rb +0 -149
- data/spec/runtime/load_spec.rb +0 -107
- data/spec/runtime/platform_spec.rb +0 -90
- data/spec/runtime/require_spec.rb +0 -332
- data/spec/runtime/setup_spec.rb +0 -853
- data/spec/runtime/with_clean_env_spec.rb +0 -91
- data/spec/spec_helper.rb +0 -123
- data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +0 -13
- data/spec/support/artifice/endpoint.rb +0 -71
- data/spec/support/artifice/endpoint_500.rb +0 -37
- data/spec/support/artifice/endpoint_api_forbidden.rb +0 -11
- data/spec/support/artifice/endpoint_api_missing.rb +0 -16
- data/spec/support/artifice/endpoint_basic_authentication.rb +0 -13
- data/spec/support/artifice/endpoint_creds_diff_host.rb +0 -38
- data/spec/support/artifice/endpoint_extra.rb +0 -31
- data/spec/support/artifice/endpoint_extra_api.rb +0 -32
- data/spec/support/artifice/endpoint_extra_missing.rb +0 -15
- data/spec/support/artifice/endpoint_fallback.rb +0 -17
- data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
- data/spec/support/artifice/endpoint_marshal_fail.rb +0 -11
- data/spec/support/artifice/endpoint_redirect.rb +0 -15
- data/spec/support/artifice/endpoint_strict_basic_authentication.rb +0 -18
- data/spec/support/artifice/endpoint_timeout.rb +0 -13
- data/spec/support/builders.rb +0 -693
- data/spec/support/fakeweb/rack-1.0.0.marshal +0 -2
- data/spec/support/fakeweb/windows.rb +0 -23
- data/spec/support/hax.rb +0 -22
- data/spec/support/helpers.rb +0 -361
- data/spec/support/indexes.rb +0 -280
- data/spec/support/matchers.rb +0 -77
- data/spec/support/path.rb +0 -85
- data/spec/support/permissions.rb +0 -10
- data/spec/support/platforms.rb +0 -94
- data/spec/support/ruby_ext.rb +0 -20
- data/spec/support/rubygems_ext.rb +0 -39
- data/spec/support/streams.rb +0 -13
- data/spec/support/sudo.rb +0 -16
- data/spec/update/gems_spec.rb +0 -201
- data/spec/update/git_spec.rb +0 -283
- data/spec/update/path_spec.rb +0 -18
data/spec/resolver/basic_spec.rb
DELETED
@@ -1,66 +0,0 @@
|
|
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
|
-
|
21
|
-
it "resolves a conflicting index" do
|
22
|
-
@index = a_conflict_index
|
23
|
-
dep "my_app"
|
24
|
-
should_resolve_as %w(activemodel-3.2.11 builder-3.0.4 grape-0.2.6 my_app-1.0.0)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "resolves a complex conflicting index" do
|
28
|
-
@index = a_complex_conflict_index
|
29
|
-
dep "my_app"
|
30
|
-
should_resolve_as %w(a-1.4.0 b-0.3.5 c-3.2 d-0.9.8 my_app-1.1.0)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "resolves a index with conflict on child" do
|
34
|
-
@index = index_with_conflict_on_child
|
35
|
-
dep "chef_app"
|
36
|
-
should_resolve_as %w(berkshelf-2.0.7 chef-10.26 chef_app-1.0.0 json-1.7.7)
|
37
|
-
end
|
38
|
-
|
39
|
-
it "resolves a index with root level conflict on child" do
|
40
|
-
@index = a_index_with_root_conflict_on_child
|
41
|
-
dep "i18n", "~> 0.4"
|
42
|
-
dep "activesupport", "~> 3.0"
|
43
|
-
dep "activerecord", "~> 3.0"
|
44
|
-
dep "builder", "~> 2.1.2"
|
45
|
-
should_resolve_as %w(activesupport-3.0.5 i18n-0.4.2 builder-2.1.2 activerecord-3.0.5 activemodel-3.0.5)
|
46
|
-
end
|
47
|
-
|
48
|
-
it "raises an exception if a child dependency is not resolved" do
|
49
|
-
@index = a_unresovable_child_index
|
50
|
-
dep "chef_app_error"
|
51
|
-
expect {
|
52
|
-
resolve
|
53
|
-
}.to raise_error(Bundler::VersionConflict)
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should throw error in case of circular dependencies" do
|
57
|
-
@index = a_circular_index
|
58
|
-
dep "circular_app"
|
59
|
-
|
60
|
-
got = resolve
|
61
|
-
expect {
|
62
|
-
got = got.map { |s| s.full_name }.sort
|
63
|
-
}.to raise_error(Bundler::CyclicDependencyError, /please remove either gem 'foo' or gem 'bar'/i)
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
@@ -1,88 +0,0 @@
|
|
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 x64-mingw32" 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
|
-
|
55
|
-
it "finds x64-mingw gems" do
|
56
|
-
platforms "x64-mingw32"
|
57
|
-
dep "thin"
|
58
|
-
should_resolve_as %w(thin-1.2.7-x64-mingw32)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "with conflicting cases" do
|
63
|
-
before :each do
|
64
|
-
@index = build_index do
|
65
|
-
gem "foo", "1.0.0" do
|
66
|
-
dep "bar", ">= 0"
|
67
|
-
end
|
68
|
-
|
69
|
-
gem 'bar', "1.0.0" do
|
70
|
-
dep "baz", "~> 1.0.0"
|
71
|
-
end
|
72
|
-
|
73
|
-
gem "bar", "1.0.0", "java" do
|
74
|
-
dep "baz", " ~> 1.1.0"
|
75
|
-
end
|
76
|
-
|
77
|
-
gem "baz", %w(1.0.0 1.1.0 1.2.0)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
it "reports on the conflict" do
|
82
|
-
platforms "ruby", "java"
|
83
|
-
dep "foo"
|
84
|
-
|
85
|
-
should_conflict_on "baz"
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
@@ -1,149 +0,0 @@
|
|
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
|
-
expect(out).to eq("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
|
-
expect(bundled_app("bin")).not_to exist
|
26
|
-
expect(bundled_app("gbin/rackup")).to exist
|
27
|
-
|
28
|
-
gembin bundled_app("gbin/rackup")
|
29
|
-
expect(out).to eq("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
|
-
expect(out).to eq("1.0.0")
|
37
|
-
end
|
38
|
-
|
39
|
-
it "uses the default ruby install name when shebang is not specified" do
|
40
|
-
bundle "install --binstubs"
|
41
|
-
expect(File.open("bin/rackup").gets).to eq("#!/usr/bin/env #{RbConfig::CONFIG['ruby_install_name']}\n")
|
42
|
-
end
|
43
|
-
|
44
|
-
it "allows the name of the shebang executable to be specified" do
|
45
|
-
bundle "install --binstubs --shebang ruby-foo"
|
46
|
-
expect(File.open("bin/rackup").gets).to eq("#!/usr/bin/env ruby-foo\n")
|
47
|
-
end
|
48
|
-
|
49
|
-
it "runs the bundled command when out of the bundle" do
|
50
|
-
bundle "install --binstubs"
|
51
|
-
|
52
|
-
build_gem "rack", "2.0", :to_system => true do |s|
|
53
|
-
s.executables = "rackup"
|
54
|
-
end
|
55
|
-
|
56
|
-
Dir.chdir(tmp) do
|
57
|
-
gembin "rackup"
|
58
|
-
expect(out).to eq("1.0.0")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
it "works with gems in path" do
|
63
|
-
build_lib "rack", :path => lib_path("rack") do |s|
|
64
|
-
s.executables = 'rackup'
|
65
|
-
end
|
66
|
-
|
67
|
-
gemfile <<-G
|
68
|
-
gem "rack", :path => "#{lib_path('rack')}"
|
69
|
-
G
|
70
|
-
|
71
|
-
bundle "install --binstubs"
|
72
|
-
|
73
|
-
build_gem 'rack', '2.0', :to_system => true do |s|
|
74
|
-
s.executables = 'rackup'
|
75
|
-
end
|
76
|
-
|
77
|
-
gembin "rackup"
|
78
|
-
expect(out).to eq('1.0')
|
79
|
-
end
|
80
|
-
|
81
|
-
it "don't bundle da bundla" do
|
82
|
-
build_gem "bundler", Bundler::VERSION, :to_system => true do |s|
|
83
|
-
s.executables = "bundle"
|
84
|
-
end
|
85
|
-
|
86
|
-
gemfile <<-G
|
87
|
-
source "file://#{gem_repo1}"
|
88
|
-
gem "bundler"
|
89
|
-
G
|
90
|
-
|
91
|
-
bundle "install --binstubs"
|
92
|
-
|
93
|
-
expect(bundled_app("bin/bundle")).not_to exist
|
94
|
-
end
|
95
|
-
|
96
|
-
it "does not generate bin stubs if the option was not specified" do
|
97
|
-
bundle "install"
|
98
|
-
|
99
|
-
expect(bundled_app("bin/rackup")).not_to exist
|
100
|
-
end
|
101
|
-
|
102
|
-
it "allows you to stop installing binstubs" do
|
103
|
-
bundle "install --binstubs bin/"
|
104
|
-
bundled_app("bin/rackup").rmtree
|
105
|
-
bundle "install --binstubs \"\""
|
106
|
-
|
107
|
-
expect(bundled_app("bin/rackup")).not_to exist
|
108
|
-
#expect(bundled_app("rackup")).not_to exist
|
109
|
-
|
110
|
-
bundle "config bin"
|
111
|
-
expect(out).to include("You have not configured a value for `bin`")
|
112
|
-
end
|
113
|
-
|
114
|
-
it "remembers that the option was specified" do
|
115
|
-
gemfile <<-G
|
116
|
-
source "file://#{gem_repo1}"
|
117
|
-
gem "activesupport"
|
118
|
-
G
|
119
|
-
|
120
|
-
bundle "install --binstubs"
|
121
|
-
|
122
|
-
gemfile <<-G
|
123
|
-
source "file://#{gem_repo1}"
|
124
|
-
gem "activesupport"
|
125
|
-
gem "rack"
|
126
|
-
G
|
127
|
-
|
128
|
-
bundle "install"
|
129
|
-
|
130
|
-
expect(bundled_app("bin/rackup")).to exist
|
131
|
-
end
|
132
|
-
|
133
|
-
it "rewrites bins on --binstubs (to maintain backwards compatibility)" do
|
134
|
-
gemfile <<-G
|
135
|
-
source "file://#{gem_repo1}"
|
136
|
-
gem "rack"
|
137
|
-
G
|
138
|
-
|
139
|
-
bundle "install --binstubs bin/"
|
140
|
-
|
141
|
-
File.open(bundled_app("bin/rackup"), 'wb') do |file|
|
142
|
-
file.print "OMG"
|
143
|
-
end
|
144
|
-
|
145
|
-
bundle "install"
|
146
|
-
|
147
|
-
expect(bundled_app("bin/rackup").read).to_not eq("OMG")
|
148
|
-
end
|
149
|
-
end
|
data/spec/runtime/load_spec.rb
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Bundler.load" do
|
4
|
-
before :each do
|
5
|
-
system_gems "rack-1.0.0"
|
6
|
-
# clear memoized method results
|
7
|
-
# TODO: Don't reset internal ivars
|
8
|
-
Bundler.instance_eval do
|
9
|
-
@load = nil
|
10
|
-
@runtime = nil
|
11
|
-
@definition = nil
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe "with a gemfile" do
|
16
|
-
before(:each) do
|
17
|
-
gemfile <<-G
|
18
|
-
source "file://#{gem_repo1}"
|
19
|
-
gem "rack"
|
20
|
-
G
|
21
|
-
end
|
22
|
-
|
23
|
-
it "provides a list of the env dependencies" do
|
24
|
-
expect(Bundler.load.dependencies).to have_dep("rack", ">= 0")
|
25
|
-
end
|
26
|
-
|
27
|
-
it "provides a list of the resolved gems" do
|
28
|
-
expect(Bundler.load.gems).to have_gem("rack-1.0.0", "bundler-#{Bundler::VERSION}")
|
29
|
-
end
|
30
|
-
|
31
|
-
it "ignores blank BUNDLE_GEMFILEs" do
|
32
|
-
expect {
|
33
|
-
ENV['BUNDLE_GEMFILE'] = ""
|
34
|
-
Bundler.load
|
35
|
-
}.not_to raise_error()
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "without a gemfile" do
|
41
|
-
it "raises an exception if the default gemfile is not found" do
|
42
|
-
expect {
|
43
|
-
Bundler.load
|
44
|
-
}.to raise_error(Bundler::GemfileNotFound, /could not locate gemfile/i)
|
45
|
-
end
|
46
|
-
|
47
|
-
it "raises an exception if a specified gemfile is not found" do
|
48
|
-
expect {
|
49
|
-
ENV['BUNDLE_GEMFILE'] = "omg.rb"
|
50
|
-
Bundler.load
|
51
|
-
}.to raise_error(Bundler::GemfileNotFound, /omg\.rb/)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "does not find a Gemfile above the testing directory" do
|
55
|
-
bundler_gemfile = tmp.join("../Gemfile")
|
56
|
-
unless File.exist?(bundler_gemfile)
|
57
|
-
FileUtils.touch(bundler_gemfile)
|
58
|
-
@remove_bundler_gemfile = true
|
59
|
-
end
|
60
|
-
begin
|
61
|
-
expect { Bundler.load }.to raise_error(Bundler::GemfileNotFound)
|
62
|
-
ensure
|
63
|
-
bundler_gemfile.rmtree if @remove_bundler_gemfile
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
describe "when called twice" do
|
70
|
-
it "doesn't try to load the runtime twice" do
|
71
|
-
system_gems "rack-1.0.0", "activesupport-2.3.5"
|
72
|
-
gemfile <<-G
|
73
|
-
gem "rack"
|
74
|
-
gem "activesupport", :group => :test
|
75
|
-
G
|
76
|
-
|
77
|
-
ruby <<-RUBY
|
78
|
-
require "bundler"
|
79
|
-
Bundler.setup :default
|
80
|
-
Bundler.require :default
|
81
|
-
puts RACK
|
82
|
-
begin
|
83
|
-
require "activesupport"
|
84
|
-
rescue LoadError
|
85
|
-
puts "no activesupport"
|
86
|
-
end
|
87
|
-
RUBY
|
88
|
-
|
89
|
-
expect(out.split("\n")).to eq(["1.0.0", "no activesupport"])
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe "not hurting brittle rubygems" do
|
94
|
-
it "does not inject #source into the generated YAML of the gem specs" do
|
95
|
-
system_gems "activerecord-2.3.2", "activesupport-2.3.2"
|
96
|
-
gemfile <<-G
|
97
|
-
gem "activerecord"
|
98
|
-
G
|
99
|
-
|
100
|
-
Bundler.load.specs.each do |spec|
|
101
|
-
expect(spec.to_yaml).not_to match(/^\s+source:/)
|
102
|
-
expect(spec.to_yaml).not_to match(/^\s+groups:/)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Bundler.setup with multi platform stuff" do
|
4
|
-
it "raises a friendly error when gems are missing locally" do
|
5
|
-
gemfile <<-G
|
6
|
-
source "file://#{gem_repo1}"
|
7
|
-
gem "rack"
|
8
|
-
G
|
9
|
-
|
10
|
-
lockfile <<-G
|
11
|
-
GEM
|
12
|
-
remote: file:#{gem_repo1}/
|
13
|
-
specs:
|
14
|
-
rack (1.0)
|
15
|
-
|
16
|
-
PLATFORMS
|
17
|
-
#{local_tag}
|
18
|
-
|
19
|
-
DEPENDENCIES
|
20
|
-
rack
|
21
|
-
G
|
22
|
-
|
23
|
-
ruby <<-R
|
24
|
-
begin
|
25
|
-
require 'bundler'
|
26
|
-
Bundler.setup
|
27
|
-
rescue Bundler::GemNotFound => e
|
28
|
-
puts "WIN"
|
29
|
-
end
|
30
|
-
R
|
31
|
-
|
32
|
-
expect(out).to eq("WIN")
|
33
|
-
end
|
34
|
-
|
35
|
-
it "will resolve correctly on the current platform when the lockfile was targetted for a different one" do
|
36
|
-
lockfile <<-G
|
37
|
-
GEM
|
38
|
-
remote: file:#{gem_repo1}/
|
39
|
-
specs:
|
40
|
-
nokogiri (1.4.2-java)
|
41
|
-
weakling (= 0.0.3)
|
42
|
-
weakling (0.0.3)
|
43
|
-
|
44
|
-
PLATFORMS
|
45
|
-
java
|
46
|
-
|
47
|
-
DEPENDENCIES
|
48
|
-
nokogiri
|
49
|
-
G
|
50
|
-
|
51
|
-
system_gems "nokogiri-1.4.2"
|
52
|
-
|
53
|
-
simulate_platform "x86-darwin-10"
|
54
|
-
gemfile <<-G
|
55
|
-
source "file://#{gem_repo1}"
|
56
|
-
gem "nokogiri"
|
57
|
-
G
|
58
|
-
|
59
|
-
should_be_installed "nokogiri 1.4.2"
|
60
|
-
end
|
61
|
-
|
62
|
-
it "will add the resolve for the current platform" do
|
63
|
-
lockfile <<-G
|
64
|
-
GEM
|
65
|
-
remote: file:#{gem_repo1}/
|
66
|
-
specs:
|
67
|
-
nokogiri (1.4.2-java)
|
68
|
-
weakling (= 0.0.3)
|
69
|
-
weakling (0.0.3)
|
70
|
-
|
71
|
-
PLATFORMS
|
72
|
-
java
|
73
|
-
|
74
|
-
DEPENDENCIES
|
75
|
-
nokogiri
|
76
|
-
G
|
77
|
-
|
78
|
-
simulate_platform "x86-darwin-100"
|
79
|
-
|
80
|
-
system_gems "nokogiri-1.4.2", "platform_specific-1.0-x86-darwin-100"
|
81
|
-
|
82
|
-
gemfile <<-G
|
83
|
-
source "file://#{gem_repo1}"
|
84
|
-
gem "nokogiri"
|
85
|
-
gem "platform_specific"
|
86
|
-
G
|
87
|
-
|
88
|
-
should_be_installed "nokogiri 1.4.2", "platform_specific 1.0 x86-darwin-100"
|
89
|
-
end
|
90
|
-
end
|