bundler 1.2.5 → 1.3.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.
- data/.gitignore +10 -7
- data/.travis.yml +12 -3
- data/CHANGELOG.md +26 -19
- data/CONTRIBUTE.md +97 -0
- data/README.md +4 -2
- data/Rakefile +17 -59
- data/bundler.gemspec +2 -1
- data/lib/bundler.rb +23 -20
- data/lib/bundler/cli.rb +68 -22
- data/lib/bundler/definition.rb +3 -2
- data/lib/bundler/deprecate.rb +15 -0
- data/lib/bundler/dsl.rb +14 -16
- data/lib/bundler/environment.rb +0 -5
- data/lib/bundler/fetcher.rb +23 -78
- data/lib/bundler/friendly_errors.rb +4 -5
- data/lib/bundler/gem_helper.rb +14 -16
- data/lib/bundler/injector.rb +64 -0
- data/lib/bundler/installer.rb +1 -7
- data/lib/bundler/lazy_specification.rb +6 -3
- data/lib/bundler/lockfile_parser.rb +25 -13
- data/lib/bundler/resolver.rb +0 -1
- data/lib/bundler/rubygems_integration.rb +83 -17
- data/lib/bundler/settings.rb +4 -2
- data/lib/bundler/similarity_detector.rb +63 -0
- data/lib/bundler/source.rb +3 -886
- data/lib/bundler/source/git.rb +267 -0
- data/lib/bundler/source/git/git_proxy.rb +142 -0
- data/lib/bundler/source/path.rb +209 -0
- data/lib/bundler/source/path/installer.rb +33 -0
- data/lib/bundler/source/rubygems.rb +261 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -0
- data/lib/bundler/templates/newgem/rspec.tt +2 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
- data/lib/bundler/templates/newgem/test/minitest_helper.rb.tt +4 -0
- data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +11 -0
- data/lib/bundler/ui.rb +20 -5
- data/lib/bundler/vendor/.document +0 -0
- data/lib/bundler/vendor/thor.rb +74 -5
- data/lib/bundler/vendor/thor/actions.rb +5 -5
- data/lib/bundler/vendor/thor/actions/directory.rb +1 -0
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +7 -1
- data/lib/bundler/vendor/thor/base.rb +44 -11
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +5 -0
- data/lib/bundler/vendor/thor/parser/argument.rb +14 -7
- data/lib/bundler/vendor/thor/parser/arguments.rb +7 -1
- data/lib/bundler/vendor/thor/parser/option.rb +8 -8
- data/lib/bundler/vendor/thor/parser/options.rb +62 -24
- data/lib/bundler/vendor/thor/runner.rb +1 -1
- data/lib/bundler/vendor/thor/shell/basic.rb +2 -2
- data/lib/bundler/vendor/thor/task.rb +2 -2
- data/lib/bundler/vendor/thor/version.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +3 -15
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-exec.ronn +1 -1
- data/man/bundle-update.ronn +1 -1
- data/man/bundle.ronn +4 -1
- data/spec/bundler/bundler_spec.rb +2 -28
- data/spec/bundler/cli_rspec.rb +9 -0
- data/spec/bundler/definition_spec.rb +1 -1
- data/spec/bundler/dsl_spec.rb +15 -8
- data/spec/bundler/gem_helper_spec.rb +38 -21
- data/spec/bundler/psyched_yaml_spec.rb +1 -0
- data/spec/bundler/source_spec.rb +3 -3
- data/spec/cache/gems_spec.rb +24 -24
- data/spec/cache/git_spec.rb +21 -23
- data/spec/cache/path_spec.rb +11 -11
- data/spec/cache/platform_spec.rb +6 -6
- data/spec/install/deploy_spec.rb +38 -38
- data/spec/install/gems/c_ext_spec.rb +2 -2
- data/spec/install/gems/dependency_api_spec.rb +23 -116
- data/spec/install/gems/env_spec.rb +1 -1
- data/spec/install/gems/flex_spec.rb +7 -8
- data/spec/install/gems/groups_spec.rb +10 -10
- data/spec/install/gems/packed_spec.rb +4 -4
- data/spec/install/gems/platform_spec.rb +3 -3
- data/spec/install/gems/post_install_spec.rb +9 -9
- data/spec/install/gems/resolving_spec.rb +2 -2
- data/spec/install/gems/simple_case_spec.rb +50 -53
- data/spec/install/gems/standalone_spec.rb +19 -19
- data/spec/install/gems/sudo_spec.rb +31 -16
- data/spec/install/gems/win32_spec.rb +1 -1
- data/spec/install/gemspec_spec.rb +6 -6
- data/spec/install/git_spec.rb +34 -34
- data/spec/install/invalid_spec.rb +3 -3
- data/spec/install/path_spec.rb +71 -8
- data/spec/install/upgrade_spec.rb +2 -2
- data/spec/integration/inject.rb +78 -0
- data/spec/lock/git_spec.rb +2 -2
- data/spec/lock/lockfile_spec.rb +14 -14
- data/spec/other/check_spec.rb +29 -29
- data/spec/other/clean_spec.rb +47 -48
- data/spec/other/config_spec.rb +20 -20
- data/spec/other/console_spec.rb +5 -5
- data/spec/other/exec_spec.rb +48 -28
- data/spec/other/ext_spec.rb +3 -3
- data/spec/other/help_spec.rb +6 -6
- data/spec/other/init_spec.rb +8 -8
- data/spec/other/newgem_spec.rb +95 -15
- data/spec/other/open_spec.rb +10 -5
- data/spec/other/outdated_spec.rb +8 -8
- data/spec/other/platform_spec.rb +45 -45
- data/spec/other/show_spec.rb +10 -10
- data/spec/quality_spec.rb +2 -2
- data/spec/realworld/dependency_api_spec.rb +61 -0
- data/spec/realworld/edgecases_spec.rb +8 -8
- data/spec/runtime/executable_spec.rb +13 -13
- data/spec/runtime/load_spec.rb +12 -12
- data/spec/runtime/platform_spec.rb +1 -1
- data/spec/runtime/require_spec.rb +24 -24
- data/spec/runtime/setup_spec.rb +113 -56
- data/spec/runtime/with_clean_env_spec.rb +11 -13
- data/spec/spec_helper.rb +6 -0
- data/spec/support/artifice/endpoint.rb +28 -13
- data/spec/support/artifice/endpoint_extra.rb +4 -0
- data/spec/support/builders.rb +1 -1
- data/spec/support/helpers.rb +2 -7
- data/spec/support/indexes.rb +3 -3
- data/spec/support/matchers.rb +6 -6
- data/spec/update/gems_spec.rb +19 -8
- data/spec/update/git_spec.rb +10 -10
- data/spec/update/source_spec.rb +1 -1
- metadata +86 -55
- data/.rspec +0 -2
data/spec/other/ext_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe "Gem::Specification#match_platform" do
|
4
4
|
it "does not match platforms other than the gem platform" do
|
5
5
|
darwin = gem "lol", "1.0", "platform_specific-1.0-x86-darwin-10"
|
6
|
-
darwin.match_platform(pl('java')).
|
6
|
+
expect(darwin.match_platform(pl('java'))).to be_false
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -11,7 +11,7 @@ describe "Bundler::GemHelpers#generic" do
|
|
11
11
|
include Bundler::GemHelpers
|
12
12
|
|
13
13
|
it "converts non-windows platforms into ruby" do
|
14
|
-
generic(pl('x86-darwin-10')).
|
14
|
+
expect(generic(pl('x86-darwin-10'))).to eq(pl('ruby'))
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -34,4 +34,4 @@ describe "Gem::SourceIndex#refresh!" do
|
|
34
34
|
run "Gem.source_index.refresh!"
|
35
35
|
run "Gem::SourceIndex.from_gems_in([]).refresh!"
|
36
36
|
end
|
37
|
-
end
|
37
|
+
end
|
data/spec/other/help_spec.rb
CHANGED
@@ -7,33 +7,33 @@ describe "bundle help" do
|
|
7
7
|
system_gems "bundler-0.8.1"
|
8
8
|
|
9
9
|
bundle "help", :expect_err => true
|
10
|
-
err.
|
11
|
-
err.
|
10
|
+
expect(err).to include("Please remove Bundler 0.8 versions.")
|
11
|
+
expect(err).to include("This can be done by running `gem cleanup bundler`.")
|
12
12
|
end
|
13
13
|
|
14
14
|
it "uses groff when available" do
|
15
15
|
fake_groff!
|
16
16
|
|
17
17
|
bundle "help gemfile"
|
18
|
-
out.
|
18
|
+
expect(out).to eq(%|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/gemfile.5"]|)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "prefixes bundle commands with bundle- when finding the groff files" do
|
22
22
|
fake_groff!
|
23
23
|
|
24
24
|
bundle "help install"
|
25
|
-
out.
|
25
|
+
expect(out).to eq(%|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/bundle-install"]|)
|
26
26
|
end
|
27
27
|
|
28
28
|
it "simply outputs the txt file when there is no groff on the path" do
|
29
29
|
kill_path!
|
30
30
|
|
31
31
|
bundle "help install", :expect_err => true
|
32
|
-
out.
|
32
|
+
expect(out).to match(/BUNDLE-INSTALL/)
|
33
33
|
end
|
34
34
|
|
35
35
|
it "still outputs the old help for commands that do not have man pages yet" do
|
36
36
|
bundle "help check"
|
37
|
-
out.
|
37
|
+
expect(out).to include("Check searches the local machine")
|
38
38
|
end
|
39
39
|
end
|
data/spec/other/init_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe "bundle init" do
|
4
4
|
it "generates a Gemfile" do
|
5
5
|
bundle :init
|
6
|
-
bundled_app("Gemfile").
|
6
|
+
expect(bundled_app("Gemfile")).to exist
|
7
7
|
end
|
8
8
|
|
9
9
|
it "does not change existing Gemfiles" do
|
@@ -11,9 +11,9 @@ describe "bundle init" do
|
|
11
11
|
gem "rails"
|
12
12
|
G
|
13
13
|
|
14
|
-
|
14
|
+
expect {
|
15
15
|
bundle :init
|
16
|
-
}.
|
16
|
+
}.not_to change { File.read(bundled_app("Gemfile")) }
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should generate from an existing gemspec" do
|
@@ -31,10 +31,10 @@ describe "bundle init" do
|
|
31
31
|
bundle :init, :gemspec => spec_file
|
32
32
|
|
33
33
|
gemfile = bundled_app("Gemfile").read
|
34
|
-
gemfile.
|
35
|
-
gemfile.scan(/gem "rack", "= 1.0.1"/).size.
|
36
|
-
gemfile.scan(/gem "rspec", "= 1.2"/).size.
|
37
|
-
gemfile.scan(/group :development/).size.
|
34
|
+
expect(gemfile).to match(/source :gemcutter/)
|
35
|
+
expect(gemfile.scan(/gem "rack", "= 1.0.1"/).size).to eq(1)
|
36
|
+
expect(gemfile.scan(/gem "rspec", "= 1.2"/).size).to eq(1)
|
37
|
+
expect(gemfile.scan(/group :development/).size).to eq(1)
|
38
38
|
end
|
39
39
|
|
40
|
-
end
|
40
|
+
end
|
data/spec/other/newgem_spec.rb
CHANGED
@@ -19,30 +19,30 @@ describe "bundle gem" do
|
|
19
19
|
let(:generated_gem) { Bundler::GemHelper.new(bundled_app("test-gem").to_s) }
|
20
20
|
|
21
21
|
it "generates a gem skeleton" do
|
22
|
-
bundled_app("test-gem/test-gem.gemspec").
|
23
|
-
bundled_app("test-gem/LICENSE.txt").
|
24
|
-
bundled_app("test-gem/Gemfile").
|
25
|
-
bundled_app("test-gem/Rakefile").
|
26
|
-
bundled_app("test-gem/lib/test-gem.rb").
|
27
|
-
bundled_app("test-gem/lib/test-gem/version.rb").
|
22
|
+
expect(bundled_app("test-gem/test-gem.gemspec")).to exist
|
23
|
+
expect(bundled_app("test-gem/LICENSE.txt")).to exist
|
24
|
+
expect(bundled_app("test-gem/Gemfile")).to exist
|
25
|
+
expect(bundled_app("test-gem/Rakefile")).to exist
|
26
|
+
expect(bundled_app("test-gem/lib/test-gem.rb")).to exist
|
27
|
+
expect(bundled_app("test-gem/lib/test-gem/version.rb")).to exist
|
28
28
|
end
|
29
29
|
|
30
30
|
it "starts with version 0.0.1" do
|
31
|
-
bundled_app("test-gem/lib/test-gem/version.rb").read.
|
31
|
+
expect(bundled_app("test-gem/lib/test-gem/version.rb").read).to match(/VERSION = "0.0.1"/)
|
32
32
|
end
|
33
33
|
|
34
34
|
it "nests constants so they work" do
|
35
|
-
bundled_app("test-gem/lib/test-gem/version.rb").read.
|
36
|
-
bundled_app("test-gem/lib/test-gem.rb").read.
|
35
|
+
expect(bundled_app("test-gem/lib/test-gem/version.rb").read).to match(/module Test\n module Gem/)
|
36
|
+
expect(bundled_app("test-gem/lib/test-gem.rb").read).to match(/module Test\n module Gem/)
|
37
37
|
end
|
38
38
|
|
39
39
|
context "git config user.{name,email} present" do
|
40
40
|
it "sets gemspec author to git user.name if available" do
|
41
|
-
generated_gem.gemspec.authors.first.
|
41
|
+
expect(generated_gem.gemspec.authors.first).to eq("Bundler User")
|
42
42
|
end
|
43
43
|
|
44
44
|
it "sets gemspec email to git user.email if available" do
|
45
|
-
generated_gem.gemspec.email.first.
|
45
|
+
expect(generated_gem.gemspec.email.first).to eq("user@example.com")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -56,16 +56,20 @@ describe "bundle gem" do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "sets gemspec author to default message if git user.name is not set or empty" do
|
59
|
-
generated_gem.gemspec.authors.first.
|
59
|
+
expect(generated_gem.gemspec.authors.first).to eq("TODO: Write your name")
|
60
60
|
end
|
61
61
|
|
62
62
|
it "sets gemspec email to default message if git user.email is not set or empty" do
|
63
|
-
generated_gem.gemspec.email.first.
|
63
|
+
expect(generated_gem.gemspec.email.first).to eq("TODO: Write your email address")
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
it "sets gemspec license to MIT by default" do
|
68
|
+
expect(generated_gem.gemspec.license).to eq("MIT")
|
69
|
+
end
|
70
|
+
|
67
71
|
it "requires the version file" do
|
68
|
-
bundled_app("test-gem/lib/test-gem.rb").read.
|
72
|
+
expect(bundled_app("test-gem/lib/test-gem.rb").read).to match(/require "test-gem\/version"/)
|
69
73
|
end
|
70
74
|
|
71
75
|
it "runs rake without problems" do
|
@@ -82,7 +86,83 @@ RAKEFILE
|
|
82
86
|
|
83
87
|
Dir.chdir(bundled_app("test-gem")) do
|
84
88
|
sys_exec("rake")
|
85
|
-
out.
|
89
|
+
expect(out).to include("SUCCESS")
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
context "--bin parameter set" do
|
94
|
+
before :each do
|
95
|
+
reset!
|
96
|
+
in_app_root
|
97
|
+
bundle 'gem test-gem --bin'
|
98
|
+
end
|
99
|
+
|
100
|
+
it "builds bin skeleton" do
|
101
|
+
expect(bundled_app("test-gem/bin/test-gem")).to exist
|
102
|
+
end
|
103
|
+
|
104
|
+
it "requires 'test-gem'" do
|
105
|
+
expect(bundled_app("test-gem/bin/test-gem").read).to match(/require 'test-gem'/)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
context "--test parameter set to rspec" do
|
110
|
+
before :each do
|
111
|
+
reset!
|
112
|
+
in_app_root
|
113
|
+
bundle "gem test-gem --test=rspec"
|
114
|
+
end
|
115
|
+
|
116
|
+
it "builds spec skeleton" do
|
117
|
+
expect(bundled_app("test-gem/.rspec")).to exist
|
118
|
+
expect(bundled_app("test-gem/spec/test-gem_spec.rb")).to exist
|
119
|
+
expect(bundled_app("test-gem/spec/spec_helper.rb")).to exist
|
120
|
+
end
|
121
|
+
|
122
|
+
it "requires 'test-gem'" do
|
123
|
+
expect(bundled_app("test-gem/spec/spec_helper.rb").read).to match(/require 'test-gem'/)
|
124
|
+
end
|
125
|
+
|
126
|
+
it "creates a default test which fails" do
|
127
|
+
expect(bundled_app("test-gem/spec/test-gem_spec.rb").read).to match(/false.should be_true/)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
context "--test parameter set to minitest" do
|
132
|
+
before :each do
|
133
|
+
reset!
|
134
|
+
in_app_root
|
135
|
+
bundle "gem test-gem --test=minitest"
|
136
|
+
end
|
137
|
+
|
138
|
+
it "builds spec skeleton" do
|
139
|
+
expect(bundled_app("test-gem/test/test_test-gem.rb")).to exist
|
140
|
+
expect(bundled_app("test-gem/test/minitest_helper.rb")).to exist
|
141
|
+
end
|
142
|
+
|
143
|
+
it "requires 'test-gem'" do
|
144
|
+
expect(bundled_app("test-gem/test/minitest_helper.rb").read).to match(/require 'test-gem'/)
|
145
|
+
end
|
146
|
+
|
147
|
+
it "requires 'minitest_helper'" do
|
148
|
+
expect(bundled_app("test-gem/test/test_test-gem.rb").read).to match(/require '.\/minitest_helper'/)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "creates a default test which fails" do
|
152
|
+
expect(bundled_app("test-gem/test/test_test-gem.rb").read).to match(/assert false/)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
context "--test with no arguments" do
|
157
|
+
before :each do
|
158
|
+
reset!
|
159
|
+
in_app_root
|
160
|
+
bundle "gem test-gem --test"
|
161
|
+
end
|
162
|
+
|
163
|
+
it "defaults to rspec" do
|
164
|
+
expect(bundled_app("test-gem/spec/spec_helper.rb")).to exist
|
165
|
+
expect(bundled_app("test-gem/test/minitest_helper.rb")).to_not exist
|
86
166
|
end
|
87
167
|
end
|
88
168
|
end
|
data/spec/other/open_spec.rb
CHANGED
@@ -10,26 +10,31 @@ describe "bundle open" do
|
|
10
10
|
|
11
11
|
it "opens the gem with BUNDLER_EDITOR as highest priority" do
|
12
12
|
bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"}
|
13
|
-
out.
|
13
|
+
expect(out).to eq("bundler_editor #{default_bundle_path('gems', 'rails-2.3.2')}")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "opens the gem with VISUAL as 2nd highest priority" do
|
17
17
|
bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => ""}
|
18
|
-
out.
|
18
|
+
expect(out).to eq("visual #{default_bundle_path('gems', 'rails-2.3.2')}")
|
19
19
|
end
|
20
20
|
|
21
21
|
it "opens the gem with EDITOR as 3rd highest priority" do
|
22
22
|
bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
|
23
|
-
out.
|
23
|
+
expect(out).to eq("editor #{default_bundle_path('gems', 'rails-2.3.2')}")
|
24
24
|
end
|
25
25
|
|
26
26
|
it "complains if no EDITOR is set" do
|
27
27
|
bundle "open rails", :env => {"EDITOR" => "", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
|
28
|
-
out.
|
28
|
+
expect(out).to eq("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR")
|
29
29
|
end
|
30
30
|
|
31
31
|
it "complains if gem not in bundle" do
|
32
32
|
bundle "open missing", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
|
33
|
-
out.
|
33
|
+
expect(out).to match(/could not find gem 'missing'/i)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "suggests alternatives for similar-sounding gems" do
|
37
|
+
bundle "open Rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
|
38
|
+
expect(out).to match(/did you mean rails\?/i)
|
34
39
|
end
|
35
40
|
end
|
data/spec/other/outdated_spec.rb
CHANGED
@@ -22,8 +22,8 @@ describe "bundle outdated" do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
bundle "outdated"
|
25
|
-
out.
|
26
|
-
out.
|
25
|
+
expect(out).to include("activesupport (3.0 > 2.3.5)")
|
26
|
+
expect(out).to include("foo (1.0")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -32,7 +32,7 @@ describe "bundle outdated" do
|
|
32
32
|
FileUtils.rm_rf(gem_repo2)
|
33
33
|
|
34
34
|
bundle "outdated --local"
|
35
|
-
out.
|
35
|
+
expect(out).not_to match(/Fetching/)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -44,8 +44,8 @@ describe "bundle outdated" do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
bundle "outdated foo"
|
47
|
-
out.
|
48
|
-
out.
|
47
|
+
expect(out).not_to include("activesupport (3.0 > 2.3.5)")
|
48
|
+
expect(out).to include("foo (1.0")
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -57,7 +57,7 @@ describe "bundle outdated" do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
bundle "outdated"
|
60
|
-
out.
|
60
|
+
expect(out).not_to include("activesupport (3.0.0.beta > 2.3.5)")
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -68,7 +68,7 @@ describe "bundle outdated" do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
bundle "outdated --pre"
|
71
|
-
out.
|
71
|
+
expect(out).to include("activesupport (3.0.0.beta > 2.3.5)")
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -85,7 +85,7 @@ describe "bundle outdated" do
|
|
85
85
|
G
|
86
86
|
|
87
87
|
bundle "outdated"
|
88
|
-
out.
|
88
|
+
expect(out).to include("activesupport (3.0.0.beta.2 > 3.0.0.beta.1)")
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
data/spec/other/platform_spec.rb
CHANGED
@@ -12,7 +12,7 @@ describe "bundle platform" do
|
|
12
12
|
G
|
13
13
|
|
14
14
|
bundle "platform"
|
15
|
-
out.
|
15
|
+
expect(out).to eq(<<-G.chomp)
|
16
16
|
Your platform is: #{RUBY_PLATFORM}
|
17
17
|
|
18
18
|
Your app has gems that work on these platforms:
|
@@ -33,7 +33,7 @@ G
|
|
33
33
|
G
|
34
34
|
|
35
35
|
bundle "platform"
|
36
|
-
out.
|
36
|
+
expect(out).to eq(<<-G.chomp)
|
37
37
|
Your platform is: #{RUBY_PLATFORM}
|
38
38
|
|
39
39
|
Your app has gems that work on these platforms:
|
@@ -53,7 +53,7 @@ G
|
|
53
53
|
G
|
54
54
|
|
55
55
|
bundle "platform"
|
56
|
-
out.
|
56
|
+
expect(out).to eq(<<-G.chomp)
|
57
57
|
Your platform is: #{RUBY_PLATFORM}
|
58
58
|
|
59
59
|
Your app has gems that work on these platforms:
|
@@ -78,7 +78,7 @@ G
|
|
78
78
|
|
79
79
|
bundle "platform --ruby"
|
80
80
|
|
81
|
-
out.
|
81
|
+
expect(out).to eq("ruby 1.9.3")
|
82
82
|
end
|
83
83
|
|
84
84
|
it "engine defaults to MRI" do
|
@@ -91,7 +91,7 @@ G
|
|
91
91
|
|
92
92
|
bundle "platform --ruby"
|
93
93
|
|
94
|
-
out.
|
94
|
+
expect(out).to eq("ruby 1.9.3")
|
95
95
|
end
|
96
96
|
|
97
97
|
it "handles jruby" do
|
@@ -104,7 +104,7 @@ G
|
|
104
104
|
|
105
105
|
bundle "platform --ruby"
|
106
106
|
|
107
|
-
out.
|
107
|
+
expect(out).to eq("ruby 1.8.7 (jruby 1.6.5)")
|
108
108
|
end
|
109
109
|
|
110
110
|
it "handles rbx" do
|
@@ -117,7 +117,7 @@ G
|
|
117
117
|
|
118
118
|
bundle "platform --ruby"
|
119
119
|
|
120
|
-
out.
|
120
|
+
expect(out).to eq("ruby 1.8.7 (rbx 1.2.4)")
|
121
121
|
end
|
122
122
|
|
123
123
|
it "raises an error if engine is used but engine version is not" do
|
@@ -130,7 +130,7 @@ G
|
|
130
130
|
|
131
131
|
bundle "platform", :exitstatus => true
|
132
132
|
|
133
|
-
exitstatus.
|
133
|
+
expect(exitstatus).not_to eq(0)
|
134
134
|
end
|
135
135
|
|
136
136
|
it "raises an error if engine_version is used but engine is not" do
|
@@ -143,7 +143,7 @@ G
|
|
143
143
|
|
144
144
|
bundle "platform", :exitstatus => true
|
145
145
|
|
146
|
-
exitstatus.
|
146
|
+
expect(exitstatus).not_to eq(0)
|
147
147
|
end
|
148
148
|
|
149
149
|
it "raises an error if engine version doesn't match ruby version for mri" do
|
@@ -156,7 +156,7 @@ G
|
|
156
156
|
|
157
157
|
bundle "platform", :exitstatus => true
|
158
158
|
|
159
|
-
exitstatus.
|
159
|
+
expect(exitstatus).not_to eq(0)
|
160
160
|
end
|
161
161
|
|
162
162
|
it "should print if no ruby version is specified" do
|
@@ -169,7 +169,7 @@ G
|
|
169
169
|
bundle "platform --ruby"
|
170
170
|
puts err
|
171
171
|
|
172
|
-
out.
|
172
|
+
expect(out).to eq("No ruby version specified")
|
173
173
|
end
|
174
174
|
end
|
175
175
|
|
@@ -180,18 +180,18 @@ G
|
|
180
180
|
let(:engine_version_incorrect) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{not_local_engine_version}\"" }
|
181
181
|
|
182
182
|
def should_be_ruby_version_incorrect(opts = {:exitstatus => true})
|
183
|
-
exitstatus.
|
184
|
-
out.
|
183
|
+
expect(exitstatus).to eq(18) if opts[:exitstatus]
|
184
|
+
expect(out).to be_include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}")
|
185
185
|
end
|
186
186
|
|
187
187
|
def should_be_engine_incorrect(opts = {:exitstatus => true})
|
188
|
-
exitstatus.
|
189
|
-
out.
|
188
|
+
expect(exitstatus).to eq(18) if opts[:exitstatus]
|
189
|
+
expect(out).to be_include("Your Ruby engine is #{local_ruby_engine}, but your Gemfile specified #{not_local_tag}")
|
190
190
|
end
|
191
191
|
|
192
192
|
def should_be_engine_version_incorrect(opts = {:exitstatus => true})
|
193
|
-
exitstatus.
|
194
|
-
out.
|
193
|
+
expect(exitstatus).to eq(18) if opts[:exitstatus]
|
194
|
+
expect(out).to be_include("Your #{local_ruby_engine} version is #{local_engine_version}, but your Gemfile specified #{local_ruby_engine} #{not_local_engine_version}")
|
195
195
|
end
|
196
196
|
|
197
197
|
context "bundle install" do
|
@@ -203,7 +203,7 @@ G
|
|
203
203
|
#{ruby_version_correct}
|
204
204
|
G
|
205
205
|
|
206
|
-
bundled_app('Gemfile.lock').
|
206
|
+
expect(bundled_app('Gemfile.lock')).to exist
|
207
207
|
end
|
208
208
|
|
209
209
|
it "installs fine with any engine" do
|
@@ -215,7 +215,7 @@ G
|
|
215
215
|
#{ruby_version_correct_engineless}
|
216
216
|
G
|
217
217
|
|
218
|
-
bundled_app('Gemfile.lock').
|
218
|
+
expect(bundled_app('Gemfile.lock')).to exist
|
219
219
|
end
|
220
220
|
end
|
221
221
|
|
@@ -227,7 +227,7 @@ G
|
|
227
227
|
#{ruby_version_incorrect}
|
228
228
|
G
|
229
229
|
|
230
|
-
bundled_app('Gemfile.lock').
|
230
|
+
expect(bundled_app('Gemfile.lock')).not_to exist
|
231
231
|
should_be_ruby_version_incorrect
|
232
232
|
end
|
233
233
|
|
@@ -239,7 +239,7 @@ G
|
|
239
239
|
#{engine_incorrect}
|
240
240
|
G
|
241
241
|
|
242
|
-
bundled_app('Gemfile.lock').
|
242
|
+
expect(bundled_app('Gemfile.lock')).not_to exist
|
243
243
|
should_be_engine_incorrect
|
244
244
|
end
|
245
245
|
|
@@ -252,7 +252,7 @@ G
|
|
252
252
|
#{engine_version_incorrect}
|
253
253
|
G
|
254
254
|
|
255
|
-
bundled_app('Gemfile.lock').
|
255
|
+
expect(bundled_app('Gemfile.lock')).not_to exist
|
256
256
|
should_be_engine_version_incorrect
|
257
257
|
end
|
258
258
|
end
|
@@ -273,8 +273,8 @@ G
|
|
273
273
|
G
|
274
274
|
|
275
275
|
bundle :check, :exitstatus => true
|
276
|
-
exitstatus.
|
277
|
-
out.
|
276
|
+
expect(exitstatus).to eq(0)
|
277
|
+
expect(out).to eq("The Gemfile's dependencies are satisfied")
|
278
278
|
end
|
279
279
|
|
280
280
|
it "checks fine with any engine" do
|
@@ -292,8 +292,8 @@ G
|
|
292
292
|
G
|
293
293
|
|
294
294
|
bundle :check, :exitstatus => true
|
295
|
-
exitstatus.
|
296
|
-
out.
|
295
|
+
expect(exitstatus).to eq(0)
|
296
|
+
expect(out).to eq("The Gemfile's dependencies are satisfied")
|
297
297
|
end
|
298
298
|
end
|
299
299
|
|
@@ -464,7 +464,7 @@ G
|
|
464
464
|
G
|
465
465
|
|
466
466
|
bundle "show rails"
|
467
|
-
out.
|
467
|
+
expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
|
468
468
|
end
|
469
469
|
|
470
470
|
it "prints path if ruby version is correct for any engine" do
|
@@ -477,7 +477,7 @@ G
|
|
477
477
|
G
|
478
478
|
|
479
479
|
bundle "show rails"
|
480
|
-
out.
|
480
|
+
expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
|
481
481
|
end
|
482
482
|
end
|
483
483
|
|
@@ -537,7 +537,7 @@ G
|
|
537
537
|
G
|
538
538
|
|
539
539
|
bundle :cache
|
540
|
-
bundled_app("vendor/cache/rack-1.0.0.gem").
|
540
|
+
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
|
541
541
|
end
|
542
542
|
|
543
543
|
it "copies the .gem file to vendor/cache when ruby version matches for any engine" do
|
@@ -549,7 +549,7 @@ G
|
|
549
549
|
G
|
550
550
|
|
551
551
|
bundle :cache
|
552
|
-
bundled_app("vendor/cache/rack-1.0.0.gem").
|
552
|
+
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
|
553
553
|
end
|
554
554
|
end
|
555
555
|
|
@@ -606,7 +606,7 @@ G
|
|
606
606
|
G
|
607
607
|
|
608
608
|
bundle :pack
|
609
|
-
bundled_app("vendor/cache/rack-1.0.0.gem").
|
609
|
+
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
|
610
610
|
end
|
611
611
|
|
612
612
|
it "copies the .gem file to vendor/cache when ruby version matches any engine" do
|
@@ -618,7 +618,7 @@ G
|
|
618
618
|
G
|
619
619
|
|
620
620
|
bundle :pack
|
621
|
-
bundled_app("vendor/cache/rack-1.0.0.gem").
|
621
|
+
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
|
622
622
|
end
|
623
623
|
end
|
624
624
|
|
@@ -671,7 +671,7 @@ G
|
|
671
671
|
G
|
672
672
|
|
673
673
|
bundle "exec rackup"
|
674
|
-
out.
|
674
|
+
expect(out).to eq("0.9.1")
|
675
675
|
end
|
676
676
|
|
677
677
|
it "activates the correct gem when ruby version matches any engine" do
|
@@ -683,7 +683,7 @@ G
|
|
683
683
|
G
|
684
684
|
|
685
685
|
bundle "exec rackup"
|
686
|
-
out.
|
686
|
+
expect(out).to eq("0.9.1")
|
687
687
|
end
|
688
688
|
end
|
689
689
|
|
@@ -747,7 +747,7 @@ G
|
|
747
747
|
input.puts("puts RACK")
|
748
748
|
input.puts("exit")
|
749
749
|
end
|
750
|
-
out.
|
750
|
+
expect(out).to include("0.9.1")
|
751
751
|
end
|
752
752
|
|
753
753
|
it "starts IRB with the default group loaded when ruby version matches any engine" do
|
@@ -765,7 +765,7 @@ G
|
|
765
765
|
input.puts("puts RACK")
|
766
766
|
input.puts("exit")
|
767
767
|
end
|
768
|
-
out.
|
768
|
+
expect(out).to include("0.9.1")
|
769
769
|
end
|
770
770
|
end
|
771
771
|
|
@@ -837,7 +837,7 @@ G
|
|
837
837
|
FileUtils.rm(bundled_app("Gemfile.lock"))
|
838
838
|
|
839
839
|
run "1"
|
840
|
-
bundled_app("Gemfile.lock").
|
840
|
+
expect(bundled_app("Gemfile.lock")).to exist
|
841
841
|
end
|
842
842
|
|
843
843
|
it "makes a Gemfile.lock if setup succeeds for any engine" do
|
@@ -855,7 +855,7 @@ G
|
|
855
855
|
FileUtils.rm(bundled_app("Gemfile.lock"))
|
856
856
|
|
857
857
|
run "1"
|
858
|
-
bundled_app("Gemfile.lock").
|
858
|
+
expect(bundled_app("Gemfile.lock")).to exist
|
859
859
|
end
|
860
860
|
end
|
861
861
|
|
@@ -883,7 +883,7 @@ G
|
|
883
883
|
end
|
884
884
|
R
|
885
885
|
|
886
|
-
bundled_app("Gemfile.lock").
|
886
|
+
expect(bundled_app("Gemfile.lock")).not_to exist
|
887
887
|
should_be_ruby_version_incorrect(:exitstatus => false)
|
888
888
|
end
|
889
889
|
|
@@ -911,7 +911,7 @@ G
|
|
911
911
|
end
|
912
912
|
R
|
913
913
|
|
914
|
-
bundled_app("Gemfile.lock").
|
914
|
+
expect(bundled_app("Gemfile.lock")).not_to exist
|
915
915
|
should_be_engine_incorrect(:exitstatus => false)
|
916
916
|
end
|
917
917
|
|
@@ -940,7 +940,7 @@ G
|
|
940
940
|
end
|
941
941
|
R
|
942
942
|
|
943
|
-
bundled_app("Gemfile.lock").
|
943
|
+
expect(bundled_app("Gemfile.lock")).not_to exist
|
944
944
|
should_be_engine_version_incorrect(:exitstatus => false)
|
945
945
|
end
|
946
946
|
end
|
@@ -974,8 +974,8 @@ G
|
|
974
974
|
G
|
975
975
|
|
976
976
|
bundle "outdated"
|
977
|
-
out.
|
978
|
-
out.
|
977
|
+
expect(out).to include("activesupport (3.0 > 2.3.5)")
|
978
|
+
expect(out).to include("foo (1.0")
|
979
979
|
end
|
980
980
|
|
981
981
|
it "returns list of outdated gems when the ruby version matches for any engine" do
|
@@ -994,8 +994,8 @@ G
|
|
994
994
|
G
|
995
995
|
|
996
996
|
bundle "outdated"
|
997
|
-
out.
|
998
|
-
out.
|
997
|
+
expect(out).to include("activesupport (3.0 > 2.3.5)")
|
998
|
+
expect(out).to include("foo (1.0")
|
999
999
|
end
|
1000
1000
|
end
|
1001
1001
|
|