appraisal 2.5.0 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/dynamic-security.yml +19 -0
- data/.github/workflows/main.yml +55 -0
- data/.gitignore +1 -0
- data/Gemfile +5 -0
- data/README.md +14 -5
- data/Rakefile +8 -6
- data/SECURITY.md +20 -0
- data/appraisal.gemspec +14 -17
- data/bin/bundle +109 -0
- data/bin/rspec +27 -0
- data/{bin → exe}/appraisal +6 -4
- data/lib/appraisal/appraisal.rb +20 -17
- data/lib/appraisal/appraisal_file.rb +8 -6
- data/lib/appraisal/bundler_dsl.rb +17 -13
- data/lib/appraisal/cli.rb +49 -43
- data/lib/appraisal/command.rb +3 -1
- data/lib/appraisal/conditional.rb +4 -0
- data/lib/appraisal/customize.rb +22 -2
- data/lib/appraisal/dependency.rb +4 -2
- data/lib/appraisal/dependency_list.rb +4 -2
- data/lib/appraisal/errors.rb +2 -0
- data/lib/appraisal/gemfile.rb +2 -0
- data/lib/appraisal/gemspec.rb +5 -3
- data/lib/appraisal/git.rb +3 -1
- data/lib/appraisal/group.rb +7 -5
- data/lib/appraisal/path.rb +3 -1
- data/lib/appraisal/platform.rb +7 -5
- data/lib/appraisal/source.rb +7 -5
- data/lib/appraisal/task.rb +8 -6
- data/lib/appraisal/utils.rb +6 -7
- data/lib/appraisal/version.rb +3 -1
- data/lib/appraisal.rb +4 -2
- data/spec/acceptance/appraisals_file_bundler_dsl_compatibility_spec.rb +55 -24
- data/spec/acceptance/bundle_with_custom_path_spec.rb +26 -20
- data/spec/acceptance/bundle_without_spec.rb +10 -10
- data/spec/acceptance/cli/clean_spec.rb +13 -11
- data/spec/acceptance/cli/generate_spec.rb +14 -12
- data/spec/acceptance/cli/help_spec.rb +15 -13
- data/spec/acceptance/cli/install_spec.rb +33 -47
- data/spec/acceptance/cli/list_spec.rb +11 -9
- data/spec/acceptance/cli/run_spec.rb +26 -24
- data/spec/acceptance/cli/update_spec.rb +20 -18
- data/spec/acceptance/cli/version_spec.rb +3 -1
- data/spec/acceptance/cli/with_no_arguments_spec.rb +10 -8
- data/spec/acceptance/gemfile_dsl_compatibility_spec.rb +38 -36
- data/spec/acceptance/gemspec_spec.rb +26 -24
- data/spec/appraisal/appraisal_file_spec.rb +66 -4
- data/spec/appraisal/appraisal_spec.rb +20 -23
- data/spec/appraisal/customize_spec.rb +133 -11
- data/spec/appraisal/dependency_list_spec.rb +3 -1
- data/spec/appraisal/gemfile_spec.rb +39 -38
- data/spec/appraisal/utils_spec.rb +21 -28
- data/spec/spec_helper.rb +14 -6
- data/spec/support/acceptance_test_helpers.rb +31 -24
- data/spec/support/dependency_helpers.rb +29 -15
- data/spec/support/stream_helpers.rb +2 -0
- metadata +10 -34
- data/.rspec +0 -1
@@ -1,51 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "spec_helper"
|
2
4
|
|
3
|
-
describe "Bundle with custom path" do
|
4
|
-
let(:gem_name) {
|
5
|
-
let(:path) {
|
5
|
+
RSpec.describe "Bundle with custom path" do
|
6
|
+
let(:gem_name) { "rack" }
|
7
|
+
let(:path) { "vendor/bundle" }
|
6
8
|
|
7
9
|
shared_examples :gemfile_dependencies_are_satisfied do
|
8
|
-
|
9
|
-
|
10
|
-
build_gemfile <<-Gemfile
|
10
|
+
it "installs gems in the --path directory" do
|
11
|
+
build_gemfile <<-GEMFILE
|
11
12
|
source "https://rubygems.org"
|
12
13
|
|
13
14
|
gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
|
14
|
-
|
15
|
+
GEMFILE
|
15
16
|
|
16
|
-
build_appraisal_file <<-
|
17
|
+
build_appraisal_file <<-APPRAISALS
|
17
18
|
appraise "#{gem_name}" do
|
18
19
|
gem '#{gem_name}'
|
19
20
|
end
|
20
|
-
|
21
|
+
APPRAISALS
|
21
22
|
|
22
|
-
run
|
23
|
-
run
|
23
|
+
run "bundle config set --local path #{path}"
|
24
|
+
run "bundle install"
|
25
|
+
run "bundle exec appraisal install"
|
24
26
|
|
25
|
-
installed_gem = Dir.glob("tmp/stage/#{path}/#{Gem.ruby_engine}/*/gems/*")
|
26
|
-
|
27
|
-
|
27
|
+
installed_gem = Dir.glob("tmp/stage/#{path}/#{Gem.ruby_engine}/*/gems/*")
|
28
|
+
.map { |path| path.split("/").last }
|
29
|
+
.select { |gem| gem.include?(gem_name) }
|
28
30
|
expect(installed_gem).not_to be_empty
|
29
31
|
|
30
|
-
bundle_output = run
|
32
|
+
bundle_output = run "bundle check"
|
31
33
|
expect(bundle_output).to include("The Gemfile's dependencies are satisfied")
|
32
34
|
|
33
|
-
appraisal_output = run
|
35
|
+
appraisal_output = run "bundle exec appraisal install"
|
34
36
|
expect(appraisal_output).to include("The Gemfile's dependencies are satisfied")
|
37
|
+
|
38
|
+
run "bundle config unset --local path"
|
35
39
|
end
|
36
40
|
end
|
37
41
|
|
38
42
|
include_examples :gemfile_dependencies_are_satisfied
|
39
43
|
|
40
|
-
context
|
44
|
+
context "when already installed in vendor/another" do
|
41
45
|
before do
|
42
|
-
build_gemfile <<-
|
46
|
+
build_gemfile <<-GEMFILE
|
43
47
|
source "https://rubygems.org"
|
44
48
|
|
45
49
|
gem '#{gem_name}'
|
46
|
-
|
50
|
+
GEMFILE
|
47
51
|
|
48
|
-
run
|
52
|
+
run "bundle config set --local path vendor/another"
|
53
|
+
run "bundle install"
|
54
|
+
run "bundle config unset --local path"
|
49
55
|
end
|
50
56
|
|
51
57
|
include_examples :gemfile_dependencies_are_satisfied
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "spec_helper"
|
2
4
|
|
3
|
-
describe "Bundler without flag" do
|
5
|
+
RSpec.describe "Bundler without flag" do
|
4
6
|
it "passes --without flag to Bundler on install" do
|
5
|
-
build_gems %w
|
7
|
+
build_gems %w[pancake orange_juice waffle coffee sausage soda]
|
6
8
|
|
7
|
-
build_gemfile <<-
|
9
|
+
build_gemfile <<-GEMFILE
|
8
10
|
source "https://rubygems.org"
|
9
11
|
|
10
12
|
gem "pancake"
|
@@ -15,9 +17,9 @@ describe "Bundler without flag" do
|
|
15
17
|
end
|
16
18
|
|
17
19
|
gem "appraisal", :path => #{PROJECT_ROOT.inspect}
|
18
|
-
|
20
|
+
GEMFILE
|
19
21
|
|
20
|
-
build_appraisal_file <<-
|
22
|
+
build_appraisal_file <<-APPRAISALS
|
21
23
|
appraise "breakfast" do
|
22
24
|
gem "waffle"
|
23
25
|
|
@@ -33,15 +35,13 @@ describe "Bundler without flag" do
|
|
33
35
|
gem "soda"
|
34
36
|
end
|
35
37
|
end
|
36
|
-
|
38
|
+
APPRAISALS
|
37
39
|
|
38
40
|
run "bundle install --local"
|
39
|
-
|
41
|
+
run "bundle config set --local without 'drinks'"
|
42
|
+
output = run "appraisal install"
|
40
43
|
|
41
44
|
expect(output).to include("Bundle complete")
|
42
|
-
expect(output).to(
|
43
|
-
match(/Gems in the group ['"]?drinks['"]? were not installed/),
|
44
|
-
)
|
45
45
|
expect(output).not_to include("orange_juice")
|
46
46
|
expect(output).not_to include("coffee")
|
47
47
|
expect(output).not_to include("soda")
|
@@ -1,20 +1,22 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "CLI", "appraisal clean" do
|
6
|
+
it "remove all gemfiles from gemfiles directory" do
|
7
|
+
build_appraisal_file <<-APPRAISAL
|
6
8
|
appraise '1.0.0' do
|
7
9
|
gem 'dummy', '1.0.0'
|
8
10
|
end
|
9
|
-
|
11
|
+
APPRAISAL
|
10
12
|
|
11
|
-
run
|
12
|
-
write_file
|
13
|
+
run "appraisal install"
|
14
|
+
write_file "gemfiles/non_related_file", ""
|
13
15
|
|
14
|
-
run
|
16
|
+
run "appraisal clean"
|
15
17
|
|
16
|
-
expect(file
|
17
|
-
expect(file
|
18
|
-
expect(file
|
18
|
+
expect(file("gemfiles/1.0.0.gemfile")).not_to be_exists
|
19
|
+
expect(file("gemfiles/1.0.0.gemfile.lock")).not_to be_exists
|
20
|
+
expect(file("gemfiles/non_related_file")).to be_exists
|
19
21
|
end
|
20
22
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "CLI", "appraisal generate" do
|
6
|
+
it "generates the gemfiles" do
|
7
|
+
build_gemfile <<-GEMFILE
|
6
8
|
source "https://rubygems.org"
|
7
9
|
|
8
10
|
gem "appraisal", :path => "#{PROJECT_ROOT}"
|
9
|
-
|
11
|
+
GEMFILE
|
10
12
|
|
11
|
-
build_appraisal_file <<-
|
13
|
+
build_appraisal_file <<-APPRAISAL
|
12
14
|
appraise '1.0.0' do
|
13
15
|
gem 'dummy', '1.0.0'
|
14
16
|
end
|
@@ -16,19 +18,19 @@ describe 'CLI', 'appraisal generate' do
|
|
16
18
|
appraise '1.1.0' do
|
17
19
|
gem 'dummy', '1.1.0'
|
18
20
|
end
|
19
|
-
|
21
|
+
APPRAISAL
|
20
22
|
|
21
|
-
run
|
23
|
+
run "appraisal generate"
|
22
24
|
|
23
|
-
expect(file
|
24
|
-
expect(file
|
25
|
-
expect(content_of
|
25
|
+
expect(file("gemfiles/1.0.0.gemfile")).to be_exists
|
26
|
+
expect(file("gemfiles/1.1.0.gemfile")).to be_exists
|
27
|
+
expect(content_of("gemfiles/1.0.0.gemfile")).to eq <<-GEMFILE.strip_heredoc
|
26
28
|
# This file was generated by Appraisal
|
27
29
|
|
28
30
|
source "https://rubygems.org"
|
29
31
|
|
30
32
|
gem "appraisal", :path => "#{PROJECT_ROOT}"
|
31
33
|
gem "dummy", "1.0.0"
|
32
|
-
|
34
|
+
GEMFILE
|
33
35
|
end
|
34
36
|
end
|
@@ -1,24 +1,26 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "CLI", "appraisal help" do
|
6
|
+
it "prints usage along with commands, and list of appraisals" do
|
7
|
+
build_appraisal_file <<-APPRAISAL
|
6
8
|
appraise '1.0.0' do
|
7
9
|
gem 'dummy', '1.0.0'
|
8
10
|
end
|
9
|
-
|
11
|
+
APPRAISAL
|
10
12
|
|
11
|
-
output = run
|
13
|
+
output = run "appraisal help"
|
12
14
|
|
13
|
-
expect(output).to include
|
14
|
-
expect(output).to include
|
15
|
-
expect(output).to include
|
15
|
+
expect(output).to include "Usage:"
|
16
|
+
expect(output).to include "appraisal [APPRAISAL_NAME] EXTERNAL_COMMAND"
|
17
|
+
expect(output).to include "1.0.0"
|
16
18
|
end
|
17
19
|
|
18
|
-
it
|
19
|
-
output = run
|
20
|
+
it "prints out usage even Appraisals file does not exist" do
|
21
|
+
output = run "appraisal help"
|
20
22
|
|
21
|
-
expect(output).to include
|
22
|
-
expect(output).not_to include
|
23
|
+
expect(output).to include "Usage:"
|
24
|
+
expect(output).not_to include "Unable to locate"
|
23
25
|
end
|
24
26
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "CLI", "appraisal install" do
|
6
|
+
it "raises error when there is no Appraisals file" do
|
7
|
+
output = run "appraisal install 2>&1", false
|
6
8
|
|
7
9
|
expect(output).to include "Unable to locate 'Appraisals' file"
|
8
10
|
end
|
9
11
|
|
10
|
-
it
|
11
|
-
build_appraisal_file <<-
|
12
|
+
it "installs the dependencies" do
|
13
|
+
build_appraisal_file <<-APPRAISAL
|
12
14
|
appraise '1.0.0' do
|
13
15
|
gem 'dummy', '1.0.0'
|
14
16
|
end
|
@@ -16,28 +18,27 @@ describe 'CLI', 'appraisal install' do
|
|
16
18
|
appraise '1.1.0' do
|
17
19
|
gem 'dummy', '1.1.0'
|
18
20
|
end
|
19
|
-
|
21
|
+
APPRAISAL
|
20
22
|
|
21
|
-
run
|
23
|
+
run "appraisal install"
|
22
24
|
|
23
|
-
expect(file
|
24
|
-
expect(file
|
25
|
+
expect(file("gemfiles/1.0.0.gemfile.lock")).to be_exists
|
26
|
+
expect(file("gemfiles/1.1.0.gemfile.lock")).to be_exists
|
25
27
|
end
|
26
28
|
|
27
|
-
it
|
29
|
+
it "relativize directory in gemfile.lock" do
|
28
30
|
build_gemspec
|
29
31
|
add_gemspec_to_gemfile
|
30
32
|
|
31
|
-
build_appraisal_file <<-
|
33
|
+
build_appraisal_file <<-APPRAISAL
|
32
34
|
appraise '1.0.0' do
|
33
35
|
gem 'dummy', '1.0.0'
|
34
36
|
end
|
35
|
-
|
37
|
+
APPRAISAL
|
36
38
|
|
37
|
-
run
|
39
|
+
run "appraisal install"
|
38
40
|
|
39
|
-
expect(content_of("gemfiles/1.0.0.gemfile.lock")).
|
40
|
-
not_to include(current_directory)
|
41
|
+
expect(content_of("gemfiles/1.0.0.gemfile.lock")).not_to include(current_directory)
|
41
42
|
end
|
42
43
|
|
43
44
|
it "does not relativize directory of uris in gemfile.lock" do
|
@@ -46,7 +47,7 @@ describe 'CLI', 'appraisal install' do
|
|
46
47
|
|
47
48
|
build_git_gem("uri_dummy")
|
48
49
|
uri_dummy_path = "#{current_directory}/uri_dummy"
|
49
|
-
FileUtils.symlink(File.absolute_path("tmp/
|
50
|
+
FileUtils.symlink(File.absolute_path("tmp/build/uri_dummy"), uri_dummy_path)
|
50
51
|
|
51
52
|
build_appraisal_file <<-APPRAISAL
|
52
53
|
appraise '1.0.0' do
|
@@ -56,39 +57,30 @@ describe 'CLI', 'appraisal install' do
|
|
56
57
|
|
57
58
|
run "appraisal install"
|
58
59
|
|
59
|
-
expect(content_of("gemfiles/1.0.0.gemfile.lock")).
|
60
|
-
to include("file://#{uri_dummy_path}")
|
60
|
+
expect(content_of("gemfiles/1.0.0.gemfile.lock")).to include("file://#{uri_dummy_path}")
|
61
61
|
end
|
62
62
|
|
63
|
-
context
|
63
|
+
context "with job size", parallel: true do
|
64
64
|
before do
|
65
|
-
build_appraisal_file <<-
|
65
|
+
build_appraisal_file <<-APPRAISAL
|
66
66
|
appraise '1.0.0' do
|
67
67
|
gem 'dummy', '1.0.0'
|
68
68
|
end
|
69
|
-
|
69
|
+
APPRAISAL
|
70
70
|
end
|
71
71
|
|
72
|
-
it
|
73
|
-
output = run
|
72
|
+
it "accepts --jobs option to set job size" do
|
73
|
+
output = run "appraisal install --jobs=2"
|
74
74
|
|
75
|
-
expect(output).to include(
|
76
|
-
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=2"
|
77
|
-
)
|
75
|
+
expect(output).to include("bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=2")
|
78
76
|
end
|
79
77
|
|
80
|
-
it
|
81
|
-
output = run
|
82
|
-
|
83
|
-
expect(output).to
|
84
|
-
|
85
|
-
)
|
86
|
-
expect(output).not_to include(
|
87
|
-
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=0"
|
88
|
-
)
|
89
|
-
expect(output).not_to include(
|
90
|
-
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=1"
|
91
|
-
)
|
78
|
+
it "ignores --jobs option if the job size is less than or equal to 1" do
|
79
|
+
output = run "appraisal install --jobs=0"
|
80
|
+
|
81
|
+
expect(output).to include("bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}'")
|
82
|
+
expect(output).not_to include("bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=0")
|
83
|
+
expect(output).not_to include("bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=1")
|
92
84
|
end
|
93
85
|
end
|
94
86
|
|
@@ -104,10 +96,7 @@ describe 'CLI', 'appraisal install' do
|
|
104
96
|
it "accepts --full-index option to pull the full RubyGems index" do
|
105
97
|
output = run("appraisal install --full-index")
|
106
98
|
|
107
|
-
expect(output).to include(
|
108
|
-
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' " \
|
109
|
-
"--retry 1 --full-index true"
|
110
|
-
)
|
99
|
+
expect(output).to include("bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --retry 1 --full-index true")
|
111
100
|
end
|
112
101
|
end
|
113
102
|
|
@@ -123,10 +112,7 @@ describe 'CLI', 'appraisal install' do
|
|
123
112
|
it "accepts --path option to specify the location to install gems into" do
|
124
113
|
output = run("appraisal install --path vendor/appraisal")
|
125
114
|
|
126
|
-
expect(output).to include(
|
127
|
-
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' " \
|
128
|
-
"--path #{file('vendor/appraisal')} --retry 1",
|
129
|
-
)
|
115
|
+
expect(output).to include("bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --path #{file('vendor/appraisal')} --retry 1")
|
130
116
|
end
|
131
117
|
end
|
132
118
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "CLI", "appraisal list" do
|
6
|
+
it "prints list of appraisals" do
|
7
|
+
build_appraisal_file <<-APPRAISAL
|
6
8
|
appraise '1.0.0' do
|
7
9
|
gem 'dummy', '1.0.0'
|
8
10
|
end
|
@@ -12,16 +14,16 @@ describe 'CLI', 'appraisal list' do
|
|
12
14
|
appraise '1.1.0' do
|
13
15
|
gem 'dummy', '1.0.0'
|
14
16
|
end
|
15
|
-
|
17
|
+
APPRAISAL
|
16
18
|
|
17
|
-
output = run
|
19
|
+
output = run "appraisal list"
|
18
20
|
|
19
21
|
expect(output).to eq("1.0.0\n2.0.0\n1.1.0\n")
|
20
22
|
end
|
21
23
|
|
22
|
-
it
|
23
|
-
build_appraisal_file
|
24
|
-
output = run
|
24
|
+
it "prints nothing if there are no appraisals in the file" do
|
25
|
+
build_appraisal_file ""
|
26
|
+
output = run "appraisal list"
|
25
27
|
|
26
28
|
expect(output.length).to eq(0)
|
27
29
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "CLI appraisal (with arguments)" do
|
4
6
|
before do
|
5
|
-
build_appraisal_file <<-
|
7
|
+
build_appraisal_file <<-APPRAISAL
|
6
8
|
appraise '1.0.0' do
|
7
9
|
gem 'dummy', '1.0.0'
|
8
10
|
end
|
@@ -10,47 +12,47 @@ describe 'CLI appraisal (with arguments)' do
|
|
10
12
|
appraise '1.1.0' do
|
11
13
|
gem 'dummy', '1.1.0'
|
12
14
|
end
|
13
|
-
|
15
|
+
APPRAISAL
|
14
16
|
|
15
|
-
run
|
16
|
-
write_file
|
17
|
-
write_file
|
17
|
+
run "appraisal install"
|
18
|
+
write_file "test.rb", 'puts "Running: #{$dummy_version}"'
|
19
|
+
write_file "test with spaces.rb", 'puts "Running: #{$dummy_version}"'
|
18
20
|
end
|
19
21
|
|
20
|
-
it
|
21
|
-
write_file
|
22
|
+
it "sets APPRAISAL_INITIALIZED environment variable" do
|
23
|
+
write_file "test.rb", <<-TEST_FILE.strip_heredoc
|
22
24
|
if ENV['APPRAISAL_INITIALIZED']
|
23
25
|
puts "Appraisal initialized!"
|
24
26
|
end
|
25
27
|
TEST_FILE
|
26
28
|
|
27
|
-
output = run
|
28
|
-
expect(output).to include
|
29
|
+
output = run "appraisal 1.0.0 ruby -rbundler/setup -rdummy test.rb"
|
30
|
+
expect(output).to include "Appraisal initialized!"
|
29
31
|
end
|
30
32
|
|
31
|
-
context
|
32
|
-
it
|
33
|
-
output = run
|
33
|
+
context "with appraisal name" do
|
34
|
+
it "runs the given command against a correct versions of dependency" do
|
35
|
+
output = run "appraisal 1.0.0 ruby -rbundler/setup -rdummy test.rb"
|
34
36
|
|
35
|
-
expect(output).to include
|
36
|
-
expect(output).not_to include
|
37
|
+
expect(output).to include "Running: 1.0.0"
|
38
|
+
expect(output).not_to include "Running: 1.1.0"
|
37
39
|
end
|
38
40
|
end
|
39
41
|
|
40
|
-
context
|
41
|
-
it
|
42
|
-
output = run
|
42
|
+
context "without appraisal name" do
|
43
|
+
it "runs the given command against all versions of dependency" do
|
44
|
+
output = run "appraisal ruby -rbundler/setup -rdummy test.rb"
|
43
45
|
|
44
|
-
expect(output).to include
|
45
|
-
expect(output).to include
|
46
|
+
expect(output).to include "Running: 1.0.0"
|
47
|
+
expect(output).to include "Running: 1.1.0"
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
49
|
-
context
|
50
|
-
it
|
51
|
+
context "when one of the arguments contains spaces" do
|
52
|
+
it "preserves those spaces" do
|
51
53
|
command = 'appraisal 1.0.0 ruby -rbundler/setup -rdummy "test with spaces.rb"'
|
52
54
|
output = run(command)
|
53
|
-
expect(output).to include
|
55
|
+
expect(output).to include "Running: 1.0.0"
|
54
56
|
end
|
55
57
|
end
|
56
58
|
end
|
@@ -1,19 +1,21 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "CLI", "appraisal update" do
|
4
6
|
before do
|
5
|
-
build_gem
|
7
|
+
build_gem "dummy2", "1.0.0"
|
6
8
|
|
7
|
-
build_appraisal_file <<-
|
9
|
+
build_appraisal_file <<-APPRAISAL
|
8
10
|
appraise 'dummy' do
|
9
11
|
gem 'dummy', '~> 1.0.0'
|
10
12
|
gem 'dummy2', '~> 1.0.0'
|
11
13
|
end
|
12
|
-
|
14
|
+
APPRAISAL
|
13
15
|
|
14
|
-
run
|
15
|
-
build_gem
|
16
|
-
build_gem
|
16
|
+
run "appraisal install"
|
17
|
+
build_gem "dummy", "1.0.1"
|
18
|
+
build_gem "dummy2", "1.0.1"
|
17
19
|
end
|
18
20
|
|
19
21
|
after do
|
@@ -23,22 +25,22 @@ describe 'CLI', 'appraisal update' do
|
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
26
|
-
context
|
27
|
-
it
|
28
|
-
output = run
|
28
|
+
context "with no arguments" do
|
29
|
+
it "updates all the gems" do
|
30
|
+
output = run "appraisal update"
|
29
31
|
|
30
32
|
expect(output).to include("gemfiles/dummy.gemfile bundle update")
|
31
|
-
expect(content_of
|
32
|
-
expect(content_of
|
33
|
+
expect(content_of("gemfiles/dummy.gemfile.lock")).to include "dummy (1.0.1)"
|
34
|
+
expect(content_of("gemfiles/dummy.gemfile.lock")).to include "dummy2 (1.0.1)"
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
36
|
-
context
|
37
|
-
it
|
38
|
-
run
|
38
|
+
context "with a list of gems" do
|
39
|
+
it "only updates specified gems" do
|
40
|
+
run "appraisal update dummy"
|
39
41
|
|
40
|
-
expect(content_of
|
41
|
-
expect(content_of
|
42
|
+
expect(content_of("gemfiles/dummy.gemfile.lock")).to include "dummy (1.0.1)"
|
43
|
+
expect(content_of("gemfiles/dummy.gemfile.lock")).to include "dummy2 (1.0.0)"
|
42
44
|
end
|
43
45
|
end
|
44
46
|
end
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "CLI appraisal (with no arguments)" do
|
6
|
+
it "runs install command" do
|
7
|
+
build_appraisal_file <<-APPRAISAL
|
6
8
|
appraise '1.0.0' do
|
7
9
|
gem 'dummy', '1.0.0'
|
8
10
|
end
|
9
|
-
|
11
|
+
APPRAISAL
|
10
12
|
|
11
|
-
run
|
13
|
+
run "appraisal"
|
12
14
|
|
13
|
-
expect(file
|
14
|
-
expect(file
|
15
|
+
expect(file("gemfiles/1.0.0.gemfile")).to be_exists
|
16
|
+
expect(file("gemfiles/1.0.0.gemfile.lock")).to be_exists
|
15
17
|
end
|
16
18
|
end
|