rubygems-tasks 0.2.6 → 0.3.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +7 -3
- data/ChangeLog.md +15 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +1 -1
- data/README.md +112 -79
- data/gemspec.yml +6 -4
- data/lib/rubygems/tasks/build/gem.rb +5 -6
- data/lib/rubygems/tasks/build/tar.rb +5 -6
- data/lib/rubygems/tasks/build/task.rb +4 -2
- data/lib/rubygems/tasks/build/zip.rb +5 -6
- data/lib/rubygems/tasks/build.rb +61 -3
- data/lib/rubygems/tasks/console.rb +12 -9
- data/lib/rubygems/tasks/install.rb +4 -5
- data/lib/rubygems/tasks/printing.rb +2 -0
- data/lib/rubygems/tasks/project.rb +3 -1
- data/lib/rubygems/tasks/push.rb +20 -7
- data/lib/rubygems/tasks/release.rb +4 -5
- data/lib/rubygems/tasks/scm/push.rb +5 -6
- data/lib/rubygems/tasks/scm/status.rb +5 -6
- data/lib/rubygems/tasks/scm/tag.rb +9 -12
- data/lib/rubygems/tasks/scm.rb +52 -3
- data/lib/rubygems/tasks/sign/checksum.rb +21 -14
- data/lib/rubygems/tasks/sign/pgp.rb +5 -6
- data/lib/rubygems/tasks/sign/task.rb +4 -2
- data/lib/rubygems/tasks/sign.rb +42 -2
- data/lib/rubygems/tasks/task.rb +4 -2
- data/lib/rubygems/tasks.rb +67 -66
- data/spec/build_spec.rb +72 -0
- data/spec/console_spec.rb +15 -15
- data/spec/install_spec.rb +1 -1
- data/spec/project_spec.rb +19 -19
- data/spec/push_spec.rb +15 -3
- data/spec/scm/push_spec.rb +6 -6
- data/spec/scm/status_spec.rb +8 -12
- data/spec/scm/tag_spec.rb +18 -28
- data/spec/scm_spec.rb +72 -0
- data/spec/sign/pgp_spec.rb +1 -1
- data/spec/sign_spec.rb +52 -0
- data/spec/tasks_spec.rb +20 -169
- metadata +15 -15
data/spec/project_spec.rb
CHANGED
|
@@ -3,7 +3,7 @@ require 'rubygems/tasks/project'
|
|
|
3
3
|
|
|
4
4
|
describe Gem::Tasks::Project do
|
|
5
5
|
let(:rubygems_project_dir) { File.join(PROJECTS_DIR,'rubygems-project') }
|
|
6
|
-
let(:rubygems_project) { described_class.new(rubygems_project_dir)
|
|
6
|
+
let(:rubygems_project) { described_class.new(rubygems_project_dir) }
|
|
7
7
|
|
|
8
8
|
let(:rubygems_multi_project_dir) do
|
|
9
9
|
File.join(PROJECTS_DIR,'rubygems-multi-project')
|
|
@@ -14,12 +14,12 @@ describe Gem::Tasks::Project do
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
let(:bundler_project_dir) { File.join(PROJECTS_DIR,'bundler-project') }
|
|
17
|
-
let(:bundler_project) { described_class.new(bundler_project_dir)
|
|
17
|
+
let(:bundler_project) { described_class.new(bundler_project_dir) }
|
|
18
18
|
|
|
19
19
|
describe "directories" do
|
|
20
20
|
let(:directory) { rubygems_project_dir }
|
|
21
21
|
|
|
22
|
-
it "
|
|
22
|
+
it "must map paths to #{described_class} instances" do
|
|
23
23
|
project = described_class.directories[directory]
|
|
24
24
|
|
|
25
25
|
expect(project.root).to eq(directory)
|
|
@@ -29,7 +29,7 @@ describe Gem::Tasks::Project do
|
|
|
29
29
|
describe "#name" do
|
|
30
30
|
subject { rubygems_project }
|
|
31
31
|
|
|
32
|
-
it "
|
|
32
|
+
it "must use the name of the directory" do
|
|
33
33
|
expect(subject.name).to eq('rubygems-project')
|
|
34
34
|
end
|
|
35
35
|
end
|
|
@@ -37,7 +37,7 @@ describe Gem::Tasks::Project do
|
|
|
37
37
|
describe "#scm" do
|
|
38
38
|
subject { bundler_project }
|
|
39
39
|
|
|
40
|
-
it "
|
|
40
|
+
it "must detect the SCM used" do
|
|
41
41
|
expect(subject.scm).to eq(:git)
|
|
42
42
|
end
|
|
43
43
|
end
|
|
@@ -46,7 +46,7 @@ describe Gem::Tasks::Project do
|
|
|
46
46
|
context "with single-gemspec project" do
|
|
47
47
|
subject { rubygems_project }
|
|
48
48
|
|
|
49
|
-
it "
|
|
49
|
+
it "must load the single-gemspec" do
|
|
50
50
|
expect(subject.gemspecs.values.map(&:name)).to eq(%w[rubygems-project])
|
|
51
51
|
end
|
|
52
52
|
end
|
|
@@ -54,7 +54,7 @@ describe Gem::Tasks::Project do
|
|
|
54
54
|
context "with multi-gemspec project" do
|
|
55
55
|
subject { rubygems_multi_project }
|
|
56
56
|
|
|
57
|
-
it "
|
|
57
|
+
it "must load all gemspecs" do
|
|
58
58
|
expect(subject.gemspecs.values.map(&:name)).to match_array(%w[
|
|
59
59
|
rubygems-project
|
|
60
60
|
rubygems-project-lite
|
|
@@ -67,7 +67,7 @@ describe Gem::Tasks::Project do
|
|
|
67
67
|
context "with single-gemspec project" do
|
|
68
68
|
subject { rubygems_project }
|
|
69
69
|
|
|
70
|
-
it "
|
|
70
|
+
it "must match the directory name to the gemspec" do
|
|
71
71
|
expect(subject.primary_gemspec).to eq(subject.name)
|
|
72
72
|
end
|
|
73
73
|
end
|
|
@@ -75,7 +75,7 @@ describe Gem::Tasks::Project do
|
|
|
75
75
|
context "with multi-gemspec project" do
|
|
76
76
|
subject { rubygems_multi_project }
|
|
77
77
|
|
|
78
|
-
it "
|
|
78
|
+
it "must pick the first gemspec" do
|
|
79
79
|
expect(subject.primary_gemspec).to eq('rubygems-project')
|
|
80
80
|
end
|
|
81
81
|
end
|
|
@@ -85,11 +85,11 @@ describe Gem::Tasks::Project do
|
|
|
85
85
|
context "with single-gemspec project" do
|
|
86
86
|
subject { rubygems_project }
|
|
87
87
|
|
|
88
|
-
it "
|
|
88
|
+
it "must default the directory name to the gemspec" do
|
|
89
89
|
expect(subject.gemspec.name).to eq(subject.name)
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
-
it "
|
|
92
|
+
it "must raise an ArgumentError for unknown gemspec names" do
|
|
93
93
|
expect { subject.gemspec('foo') }.to raise_error(ArgumentError)
|
|
94
94
|
end
|
|
95
95
|
end
|
|
@@ -97,11 +97,11 @@ describe Gem::Tasks::Project do
|
|
|
97
97
|
context "with multi-gemspec project" do
|
|
98
98
|
subject { rubygems_multi_project }
|
|
99
99
|
|
|
100
|
-
it "
|
|
100
|
+
it "must default the first gemspec" do
|
|
101
101
|
expect(subject.gemspec.name).to eq('rubygems-project')
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
it "
|
|
104
|
+
it "must allow accessing alternate gemspecs" do
|
|
105
105
|
alternate = 'rubygems-project-lite'
|
|
106
106
|
|
|
107
107
|
expect(subject.gemspec(alternate).name).to eq(alternate)
|
|
@@ -112,11 +112,11 @@ describe Gem::Tasks::Project do
|
|
|
112
112
|
describe "#builds" do
|
|
113
113
|
subject { rubygems_multi_project }
|
|
114
114
|
|
|
115
|
-
it "
|
|
115
|
+
it "must group builds by gemspec name" do
|
|
116
116
|
expect(subject.builds.keys).to be == subject.gemspecs.keys
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
it "
|
|
119
|
+
it "must map a package format to a pkg/ path" do
|
|
120
120
|
packages = subject.builds['rubygems-project']
|
|
121
121
|
|
|
122
122
|
expect(packages['tar.gz']).to eq('pkg/rubygems-project-1.2.3.tar.gz')
|
|
@@ -125,7 +125,7 @@ describe Gem::Tasks::Project do
|
|
|
125
125
|
context "with single-gemspec project" do
|
|
126
126
|
subject { rubygems_project }
|
|
127
127
|
|
|
128
|
-
it "
|
|
128
|
+
it "must only have a key for the single-gemspec" do
|
|
129
129
|
expect(subject.builds.keys).to eq(%w[rubygems-project])
|
|
130
130
|
end
|
|
131
131
|
end
|
|
@@ -133,7 +133,7 @@ describe Gem::Tasks::Project do
|
|
|
133
133
|
context "with multi-gemspec project" do
|
|
134
134
|
subject { rubygems_multi_project }
|
|
135
135
|
|
|
136
|
-
it "
|
|
136
|
+
it "must have keys for each gemspec" do
|
|
137
137
|
expect(subject.builds.keys).to match_array(%w[
|
|
138
138
|
rubygems-project
|
|
139
139
|
rubygems-project-lite
|
|
@@ -146,7 +146,7 @@ describe Gem::Tasks::Project do
|
|
|
146
146
|
context "with Bundler" do
|
|
147
147
|
subject { bundler_project }
|
|
148
148
|
|
|
149
|
-
it "
|
|
149
|
+
it "must detect the 'Gemfile' file" do
|
|
150
150
|
expect(subject.bundler?).to be_truthy
|
|
151
151
|
end
|
|
152
152
|
end
|
|
@@ -154,7 +154,7 @@ describe Gem::Tasks::Project do
|
|
|
154
154
|
context "without Bundler" do
|
|
155
155
|
subject { rubygems_project }
|
|
156
156
|
|
|
157
|
-
it "
|
|
157
|
+
it "must be false" do
|
|
158
158
|
expect(subject.bundler?).to be_falsey
|
|
159
159
|
end
|
|
160
160
|
end
|
data/spec/push_spec.rb
CHANGED
|
@@ -10,7 +10,7 @@ describe Gem::Tasks::Push do
|
|
|
10
10
|
let(:path) { 'pkg/foo-1.2.3.gem' }
|
|
11
11
|
|
|
12
12
|
context "defaults" do
|
|
13
|
-
it "
|
|
13
|
+
it "must use `gem push`" do
|
|
14
14
|
expect(subject).to receive(:run).with('gem', 'push', path)
|
|
15
15
|
|
|
16
16
|
subject.push(path)
|
|
@@ -20,13 +20,25 @@ describe Gem::Tasks::Push do
|
|
|
20
20
|
context "with custom :host" do
|
|
21
21
|
let(:host) { 'internal.company.com' }
|
|
22
22
|
|
|
23
|
-
subject { described_class.new(:
|
|
23
|
+
subject { described_class.new(host: host) }
|
|
24
24
|
|
|
25
|
-
it "
|
|
25
|
+
it "must include the --host option" do
|
|
26
26
|
expect(subject).to receive(:run).with('gem', 'push', path, '--host', host)
|
|
27
27
|
|
|
28
28
|
subject.push(path)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
+
|
|
32
|
+
context "with custom :key" do
|
|
33
|
+
let(:key) { '098f6bcd4621d373cade4e832627b4f6' }
|
|
34
|
+
|
|
35
|
+
subject { described_class.new(key: key) }
|
|
36
|
+
|
|
37
|
+
it "should include the --key option" do
|
|
38
|
+
expect(subject).to receive(:run).with('gem', 'push', path, '--key', key)
|
|
39
|
+
|
|
40
|
+
subject.push(path)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
31
43
|
end
|
|
32
44
|
end
|
data/spec/scm/push_spec.rb
CHANGED
|
@@ -5,8 +5,8 @@ require 'rubygems/tasks/scm/push'
|
|
|
5
5
|
|
|
6
6
|
describe Gem::Tasks::SCM::Push do
|
|
7
7
|
describe "#push!" do
|
|
8
|
-
context "git" do
|
|
9
|
-
it "
|
|
8
|
+
context "when the project's SCM type is :git" do
|
|
9
|
+
it "must run `git push --tags`" do
|
|
10
10
|
allow(subject.project).to receive(:scm).and_return(:git)
|
|
11
11
|
expect(subject).to receive(:run).with('git', 'push')
|
|
12
12
|
expect(subject).to receive(:run).with('git', 'push', '--tags')
|
|
@@ -15,8 +15,8 @@ describe Gem::Tasks::SCM::Push do
|
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
context "hg" do
|
|
19
|
-
it "
|
|
18
|
+
context "when the project's SCM type is :hg" do
|
|
19
|
+
it "must run `hg push`" do
|
|
20
20
|
allow(subject.project).to receive(:scm).and_return(:hg)
|
|
21
21
|
expect(subject).to receive(:run).with('hg', 'push')
|
|
22
22
|
|
|
@@ -24,8 +24,8 @@ describe Gem::Tasks::SCM::Push do
|
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
context "
|
|
28
|
-
it "
|
|
27
|
+
context "when the project's SCM type is :svn" do
|
|
28
|
+
it "must return true" do
|
|
29
29
|
allow(subject.project).to receive(:scm).and_return(:svn)
|
|
30
30
|
|
|
31
31
|
expect(subject.push!).to eq(true)
|
data/spec/scm/status_spec.rb
CHANGED
|
@@ -4,11 +4,11 @@ require 'rake_context'
|
|
|
4
4
|
require 'rubygems/tasks/scm/status'
|
|
5
5
|
|
|
6
6
|
describe Gem::Tasks::SCM::Status do
|
|
7
|
-
|
|
8
|
-
context "git" do
|
|
9
|
-
include_context "rake"
|
|
7
|
+
include_context "rake"
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
describe "#status" do
|
|
10
|
+
context "when the project's SCM type is :git" do
|
|
11
|
+
it "must run `git status --untracked-files=no`" do
|
|
12
12
|
allow(subject.project).to receive(:scm).and_return(:git)
|
|
13
13
|
|
|
14
14
|
expect(subject).to receive(:run).with(
|
|
@@ -19,10 +19,8 @@ describe Gem::Tasks::SCM::Status do
|
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
context "hg" do
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
it "should run `hg status --quiet`" do
|
|
22
|
+
context "when the project's SCM type is :hg" do
|
|
23
|
+
it "must run `hg status --quiet`" do
|
|
26
24
|
allow(subject.project).to receive(:scm).and_return(:hg)
|
|
27
25
|
|
|
28
26
|
expect(subject).to receive(:run).with(
|
|
@@ -33,10 +31,8 @@ describe Gem::Tasks::SCM::Status do
|
|
|
33
31
|
end
|
|
34
32
|
end
|
|
35
33
|
|
|
36
|
-
context "svn" do
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
it "should run `svn status --quiet`" do
|
|
34
|
+
context "when the project's SCM type is :svn" do
|
|
35
|
+
it "must run `svn status --quiet`" do
|
|
40
36
|
allow(subject.project).to receive(:scm).and_return(:svn)
|
|
41
37
|
|
|
42
38
|
expect(subject).to receive(:run).with(
|
data/spec/scm/tag_spec.rb
CHANGED
|
@@ -4,35 +4,33 @@ require 'rake_context'
|
|
|
4
4
|
require 'rubygems/tasks/scm/tag'
|
|
5
5
|
|
|
6
6
|
describe Gem::Tasks::SCM::Tag do
|
|
7
|
+
include_context "rake"
|
|
8
|
+
|
|
7
9
|
let(:version) { '1.2.3' }
|
|
8
10
|
|
|
9
11
|
describe "#version_tag" do
|
|
10
|
-
context "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
it "should have a 'v' prefix" do
|
|
12
|
+
context "when #format is #{described_class}::DEFAULT_FORMAT" do
|
|
13
|
+
it "must have a 'v' prefix" do
|
|
14
14
|
expect(subject.version_tag(version)).to eq("v#{version}")
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
context "
|
|
19
|
-
include_context "rake"
|
|
20
|
-
|
|
18
|
+
context "when #format is a format String" do
|
|
21
19
|
let(:format) { 'release-%s' }
|
|
22
20
|
|
|
23
21
|
subject { described_class.new(format: format) }
|
|
24
22
|
|
|
25
|
-
it "
|
|
23
|
+
it "must apply the format String to the version" do
|
|
26
24
|
expect(subject.version_tag(version)).to eq("release-#{version}")
|
|
27
25
|
end
|
|
28
26
|
end
|
|
29
27
|
|
|
30
|
-
context "
|
|
28
|
+
context "when #format is a Proc" do
|
|
31
29
|
let(:format) { proc { |ver| "REL_" + ver.tr('.','_') } }
|
|
32
30
|
|
|
33
31
|
subject { described_class.new(format: format) }
|
|
34
32
|
|
|
35
|
-
it "
|
|
33
|
+
it "must call the format Proc with the version" do
|
|
36
34
|
expect(subject.version_tag(version)).to eq("REL_1_2_3")
|
|
37
35
|
end
|
|
38
36
|
end
|
|
@@ -42,13 +40,11 @@ describe Gem::Tasks::SCM::Tag do
|
|
|
42
40
|
let(:name) { "v#{version}" }
|
|
43
41
|
let(:message) { "Tagging #{name}" }
|
|
44
42
|
|
|
45
|
-
context "git" do
|
|
46
|
-
context "
|
|
47
|
-
include_context "rake"
|
|
48
|
-
|
|
43
|
+
context "when the project's SCM type is :git" do
|
|
44
|
+
context "but signing is disabled" do
|
|
49
45
|
subject { described_class.new(sign: false) }
|
|
50
46
|
|
|
51
|
-
it "
|
|
47
|
+
it "must run `git tag`" do
|
|
52
48
|
allow(subject.project).to receive(:scm).and_return(:git)
|
|
53
49
|
|
|
54
50
|
expect(subject).to receive(:run).with(
|
|
@@ -59,12 +55,10 @@ describe Gem::Tasks::SCM::Tag do
|
|
|
59
55
|
end
|
|
60
56
|
end
|
|
61
57
|
|
|
62
|
-
context "signing" do
|
|
63
|
-
include_context "rake"
|
|
64
|
-
|
|
58
|
+
context "and signing is enabled" do
|
|
65
59
|
subject { described_class.new(sign: true) }
|
|
66
60
|
|
|
67
|
-
it "
|
|
61
|
+
it "must run `git tag -s`" do
|
|
68
62
|
allow(subject.project).to receive(:scm).and_return(:git)
|
|
69
63
|
|
|
70
64
|
expect(subject).to receive(:run).with(
|
|
@@ -76,13 +70,11 @@ describe Gem::Tasks::SCM::Tag do
|
|
|
76
70
|
end
|
|
77
71
|
end
|
|
78
72
|
|
|
79
|
-
context "hg" do
|
|
80
|
-
context "
|
|
81
|
-
include_context "rake"
|
|
82
|
-
|
|
73
|
+
context "when the project's SCM type is :hg" do
|
|
74
|
+
context "but signing is disabled" do
|
|
83
75
|
subject { described_class.new(sign: false) }
|
|
84
76
|
|
|
85
|
-
it "
|
|
77
|
+
it "must run `hg tag`" do
|
|
86
78
|
allow(subject.project).to receive(:scm).and_return(:hg)
|
|
87
79
|
|
|
88
80
|
expect(subject).to receive(:run).with(
|
|
@@ -93,12 +85,10 @@ describe Gem::Tasks::SCM::Tag do
|
|
|
93
85
|
end
|
|
94
86
|
end
|
|
95
87
|
|
|
96
|
-
context "
|
|
97
|
-
include_context "rake"
|
|
98
|
-
|
|
88
|
+
context "and signing is enabled" do
|
|
99
89
|
subject { described_class.new(sign: true) }
|
|
100
90
|
|
|
101
|
-
it "
|
|
91
|
+
it "must run `hg sign` then `hg tag`" do
|
|
102
92
|
allow(subject.project).to receive(:scm).and_return(:hg)
|
|
103
93
|
|
|
104
94
|
expect(subject).to receive(:run).with(
|
data/spec/scm_spec.rb
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'rake_context'
|
|
3
|
+
|
|
4
|
+
require 'rubygems/tasks/scm'
|
|
5
|
+
|
|
6
|
+
describe Gem::Tasks::SCM do
|
|
7
|
+
include_context "rake"
|
|
8
|
+
|
|
9
|
+
describe "#initialize" do
|
|
10
|
+
context "when given no keyword arguments" do
|
|
11
|
+
it "must initialize #status by default" do
|
|
12
|
+
expect(subject.status).to be_a(Gem::Tasks::SCM::Status)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "must initialize #tag by default" do
|
|
16
|
+
expect(subject.tag).to be_a(Gem::Tasks::SCM::Tag)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "must initialize #push by default" do
|
|
20
|
+
expect(subject.push).to be_a(Gem::Tasks::SCM::Push)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
context "when given `status: true`" do
|
|
25
|
+
subject { described_class.new(status: true) }
|
|
26
|
+
|
|
27
|
+
it "must initialize #status" do
|
|
28
|
+
expect(subject.status).to be_a(Gem::Tasks::SCM::Status)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
context "when given `status: false`" do
|
|
33
|
+
subject { described_class.new(status: false) }
|
|
34
|
+
|
|
35
|
+
it "must not initialize #status" do
|
|
36
|
+
expect(subject.status).to be(nil)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
context "when given `tag: true`" do
|
|
41
|
+
subject { described_class.new(tag: true) }
|
|
42
|
+
|
|
43
|
+
it "must initialize #tag" do
|
|
44
|
+
expect(subject.tag).to be_a(Gem::Tasks::SCM::Tag)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
context "when given `tag: false`" do
|
|
49
|
+
subject { described_class.new(tag: false) }
|
|
50
|
+
|
|
51
|
+
it "must not initialize #tag" do
|
|
52
|
+
expect(subject.tag).to be(nil)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
context "when given `push: true`" do
|
|
57
|
+
subject { described_class.new(push: true) }
|
|
58
|
+
|
|
59
|
+
it "must initialize #push" do
|
|
60
|
+
expect(subject.push).to be_a(Gem::Tasks::SCM::Push)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
context "when given `push: false`" do
|
|
65
|
+
subject { described_class.new(push: false) }
|
|
66
|
+
|
|
67
|
+
it "must not initialize #push" do
|
|
68
|
+
expect(subject.push).to be(nil)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
data/spec/sign/pgp_spec.rb
CHANGED
|
@@ -9,7 +9,7 @@ describe Gem::Tasks::Sign::PGP do
|
|
|
9
9
|
|
|
10
10
|
let(:path) { File.join('pkg','foo-1.2.3.gem') }
|
|
11
11
|
|
|
12
|
-
it "
|
|
12
|
+
it "must run `gpg --sign --detach-sign --armor ...`" do
|
|
13
13
|
expect(subject).to receive(:run).with(
|
|
14
14
|
'gpg', '--sign', '--detach-sign', '--armor', path
|
|
15
15
|
)
|
data/spec/sign_spec.rb
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'rake_context'
|
|
3
|
+
|
|
4
|
+
require 'rubygems/tasks/sign'
|
|
5
|
+
|
|
6
|
+
describe Gem::Tasks::Sign do
|
|
7
|
+
include_context "rake"
|
|
8
|
+
|
|
9
|
+
describe "#initialize" do
|
|
10
|
+
context "when given no keyword arguments" do
|
|
11
|
+
it "must not initialize #checksum by default" do
|
|
12
|
+
expect(subject.checksum).to be(nil)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "must not initialize #pgp by default" do
|
|
16
|
+
expect(subject.pgp).to be(nil)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
context "when given `checksum: true`" do
|
|
21
|
+
subject { described_class.new(checksum: true) }
|
|
22
|
+
|
|
23
|
+
it "must initialize #checksum" do
|
|
24
|
+
expect(subject.checksum).to be_a(Gem::Tasks::Sign::Checksum)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
context "when given `checksum: false`" do
|
|
29
|
+
subject { described_class.new(checksum: false) }
|
|
30
|
+
|
|
31
|
+
it "must not initialize #checksum" do
|
|
32
|
+
expect(subject.checksum).to be(nil)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
context "when given `pgp: true`" do
|
|
37
|
+
subject { described_class.new(pgp: true) }
|
|
38
|
+
|
|
39
|
+
it "must initialize #pgp" do
|
|
40
|
+
expect(subject.pgp).to be_a(Gem::Tasks::Sign::PGP)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
context "when given `pgp: false`" do
|
|
45
|
+
subject { described_class.new(pgp: false) }
|
|
46
|
+
|
|
47
|
+
it "must not initialize #pgp" do
|
|
48
|
+
expect(subject.pgp).to be(nil)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|