yes_ship_it 0.1.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ruby.yml +23 -0
- data/.gitignore +2 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +17 -0
- data/assertions/release_branch.rb +2 -4
- data/assertions/tag.rb +13 -5
- data/assertions/working_directory.rb +2 -0
- data/assertions/yes_it_shipped.rb +9 -3
- data/bin/yes_ship_it +1 -1
- data/lib/version.rb +1 -1
- data/lib/yes_ship_it.rb +2 -0
- data/lib/yes_ship_it/engine.rb +6 -1
- data/lib/yes_ship_it/init.rb +5 -0
- data/spec/integration/cli_spec.rb +13 -3
- data/spec/spec_helper.rb +4 -0
- data/spec/system/dry_run_spec.rb +1 -1
- data/spec/system/rpm_spec.rb +1 -1
- data/spec/system/ruby_gem_spec.rb +4 -4
- data/spec/unit/assertion_spec.rb +14 -12
- data/spec/unit/assertions/release_branch_spec.rb +17 -3
- data/spec/unit/assertions/tag_spec.rb +49 -0
- data/spec/unit/assertions/working_directory_spec.rb +15 -0
- data/spec/unit/assertions/yes_it_shipped_spec.rb +32 -8
- data/spec/unit/executor_spec.rb +1 -1
- data/yes_ship_it.gemspec +2 -1
- metadata +20 -6
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: be8b01a1d9a12d083bd94de3b302a6f2a21fb67747ee79913b435dafb32f47e1
|
4
|
+
data.tar.gz: d55a649008a05966837fc3d7d070ac7fec0fa631615711b53fed0c97b3b8d789
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dd3d86ef3169db543b724088af7ec2e9cf804737dc858cfac3c30eb50b8264ddd48eb166f641b49cce62db56f62068db82da676c6f0b306d74b0913c3cb8fc0
|
7
|
+
data.tar.gz: 860e1901d6fbc0c47dd79c4c2cee50cadff9834c6fef7afe5985455de99213cac38aa0105ad8b909a985f8eae2b0d5eb0989ad9930d17c94afee412980dda4e0
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: Ruby CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby-version: [3.0.1, 2.7.3, 2.6.7]
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ${{ matrix.ruby-version }}
|
20
|
+
- name: Install dependencies
|
21
|
+
run: bundle install
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rspec spec/unit
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Change log of yes_ship_it
|
2
2
|
|
3
|
+
## Version 0.2.1
|
4
|
+
|
5
|
+
* Make working tree check work with git 2.12
|
6
|
+
|
7
|
+
## Version 0.2.0
|
8
|
+
|
9
|
+
* Make URL of YesItShipped server where updates are posted configurable
|
10
|
+
|
11
|
+
## Version 0.1.2
|
12
|
+
|
13
|
+
* Parse time zone of tag date also in the case when it's different from local
|
14
|
+
time zone
|
15
|
+
|
16
|
+
## Version 0.1.1
|
17
|
+
|
18
|
+
* Fix failure in `yes_it_shipped` assertion when parsing tag date
|
19
|
+
|
3
20
|
## Version 0.1.0
|
4
21
|
|
5
22
|
yes_ship_it has reached a useful state, so it's going to a version scheme which
|
data/assertions/tag.rb
CHANGED
@@ -10,14 +10,21 @@ module YSI
|
|
10
10
|
@engine.tag
|
11
11
|
end
|
12
12
|
|
13
|
+
def get_tag_date(executor)
|
14
|
+
output = executor.run_command(["git", "show", tag])
|
15
|
+
if output
|
16
|
+
output.each_line do |show_line|
|
17
|
+
if show_line =~ /Date:\s+(.*)/
|
18
|
+
@engine.tag_date = Time.strptime($1,"%a %b %d %H:%M:%S %Y %z")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
13
24
|
def check
|
14
25
|
Executor.new.run_command(["git", "tag"]).each_line do |line|
|
15
26
|
if line.chomp == tag
|
16
|
-
Executor.new
|
17
|
-
if show_line =~ /Date:\s+(.*)/
|
18
|
-
@engine.tag_date = $1
|
19
|
-
end
|
20
|
-
end
|
27
|
+
get_tag_date(YSI::Executor.new)
|
21
28
|
return tag
|
22
29
|
end
|
23
30
|
end
|
@@ -26,6 +33,7 @@ module YSI
|
|
26
33
|
|
27
34
|
def assert(executor)
|
28
35
|
executor.run_command(["git", "tag", "-a", tag, "-m", engine.version])
|
36
|
+
get_tag_date(executor)
|
29
37
|
tag
|
30
38
|
end
|
31
39
|
end
|
@@ -6,9 +6,15 @@ module YSI
|
|
6
6
|
"pushed to yes-it-shipped"
|
7
7
|
end
|
8
8
|
|
9
|
+
def self.url
|
10
|
+
"https://yes-it-shipped.herokuapp.com"
|
11
|
+
end
|
12
|
+
|
13
|
+
parameter :yis_server_url, YesItShipped.url
|
14
|
+
|
9
15
|
def check
|
10
16
|
begin
|
11
|
-
RestClient.get("
|
17
|
+
RestClient.get("#{yis_server_url}/releases/#{engine.project_name}/#{engine.version}")
|
12
18
|
return "#{engine.project_name}-#{engine.version}"
|
13
19
|
rescue RestClient::ResourceNotFound
|
14
20
|
return nil
|
@@ -16,9 +22,9 @@ module YSI
|
|
16
22
|
end
|
17
23
|
|
18
24
|
def assert(executor)
|
19
|
-
executor.http_post("
|
25
|
+
executor.http_post("#{yis_server_url}/releases",
|
20
26
|
project: engine.project_name, version: engine.version,
|
21
|
-
release_date_time: engine.tag_date
|
27
|
+
release_date_time: engine.tag_date, project_url: engine.project_url,
|
22
28
|
release_url: engine.release_url, ysi_config_url: engine.config_url)
|
23
29
|
"#{engine.project_name}-#{engine.version}"
|
24
30
|
end
|
data/bin/yes_ship_it
CHANGED
data/lib/version.rb
CHANGED
data/lib/yes_ship_it.rb
CHANGED
data/lib/yes_ship_it/engine.rb
CHANGED
@@ -2,7 +2,8 @@ module YSI
|
|
2
2
|
class Engine
|
3
3
|
attr_reader :assertions
|
4
4
|
attr_reader :executor
|
5
|
-
|
5
|
+
attr_writer :tag_date
|
6
|
+
attr_accessor :version, :release_archive
|
6
7
|
attr_accessor :out
|
7
8
|
attr_accessor :data_dir
|
8
9
|
|
@@ -96,6 +97,10 @@ module YSI
|
|
96
97
|
"v#{version}"
|
97
98
|
end
|
98
99
|
|
100
|
+
def tag_date
|
101
|
+
@tag_date && @tag_date.utc
|
102
|
+
end
|
103
|
+
|
99
104
|
def release_archive_file_name
|
100
105
|
File.basename(release_archive)
|
101
106
|
end
|
data/lib/yes_ship_it/init.rb
CHANGED
@@ -42,6 +42,11 @@ module YSI
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
out.puts
|
45
|
+
out.puts "The generated configuration includes an assertion, which publishes the release on"
|
46
|
+
out.puts "#{YesItShipped.url}, our release notification service. If you"
|
47
|
+
out.puts "prefer to not publish releases there, simply remove the `yes_it_shipped`"
|
48
|
+
out.puts "assertion."
|
49
|
+
out.puts
|
45
50
|
out.puts "Check the file `yes_ship_it.conf` and adapt it to your needs."
|
46
51
|
out.puts
|
47
52
|
out.puts "Happy shipping!"
|
@@ -67,7 +67,7 @@ Checking version number: 0.0.1
|
|
67
67
|
Checking change log: CHANGELOG.md
|
68
68
|
Checking tag: v0.0.1
|
69
69
|
|
70
|
-
red_herring 0.0.1 already shipped on
|
70
|
+
red_herring 0.0.1 already shipped on 2015-06-30 22:46:19 UTC
|
71
71
|
EOT
|
72
72
|
|
73
73
|
expect(run_command(working_directory: File.join(dir, "red_herring"))).
|
@@ -300,6 +300,11 @@ Initialized directory for shipping.
|
|
300
300
|
|
301
301
|
Couldn't determine type of project, wrote a generic template.
|
302
302
|
|
303
|
+
The generated configuration includes an assertion, which publishes the release on
|
304
|
+
https://yes-it-shipped.herokuapp.com, our release notification service. If you
|
305
|
+
prefer to not publish releases there, simply remove the `yes_it_shipped`
|
306
|
+
assertion.
|
307
|
+
|
303
308
|
Check the file `yes_ship_it.conf` and adapt it to your needs.
|
304
309
|
|
305
310
|
Happy shipping!
|
@@ -320,6 +325,11 @@ Initialized directory for shipping.
|
|
320
325
|
|
321
326
|
It looks like this is is Ruby project.
|
322
327
|
|
328
|
+
The generated configuration includes an assertion, which publishes the release on
|
329
|
+
https://yes-it-shipped.herokuapp.com, our release notification service. If you
|
330
|
+
prefer to not publish releases there, simply remove the `yes_it_shipped`
|
331
|
+
assertion.
|
332
|
+
|
323
333
|
Check the file `yes_ship_it.conf` and adapt it to your needs.
|
324
334
|
|
325
335
|
Happy shipping!
|
@@ -397,7 +407,7 @@ EOT
|
|
397
407
|
end
|
398
408
|
end
|
399
409
|
|
400
|
-
plugin_path = File.join(dir, "yes_ship_it", "assertions", "my_plugin.rb")
|
410
|
+
plugin_path = File.join(path_prefix, dir, "yes_ship_it", "assertions", "my_plugin.rb")
|
401
411
|
|
402
412
|
expected_output = <<EOT
|
403
413
|
Can't generate plugin. Plugin already exists at `#{plugin_path}`.
|
@@ -408,7 +418,7 @@ EOT
|
|
408
418
|
|
409
419
|
it "creates new plugin" do
|
410
420
|
dir = given_directory
|
411
|
-
plugin_path = File.join(dir, "yes_ship_it", "assertions", "my_plugin.rb")
|
421
|
+
plugin_path = File.join(path_prefix, dir, "yes_ship_it", "assertions", "my_plugin.rb")
|
412
422
|
|
413
423
|
expected_output = <<EOT
|
414
424
|
Generated assertion plugin at `#{plugin_path}`.
|
data/spec/spec_helper.rb
CHANGED
data/spec/system/dry_run_spec.rb
CHANGED
@@ -29,7 +29,7 @@ describe "dry run" do
|
|
29
29
|
checkout_tar = File.expand_path("../data/red_herring-checkout-dry-run.tar.gz", __FILE__)
|
30
30
|
@client.inject_tarball(checkout_tar)
|
31
31
|
|
32
|
-
@client.execute(["yes_ship_it.ruby2.
|
32
|
+
@client.execute(["yes_ship_it.ruby2.5", "--dry-run"], working_directory: "red_herring")
|
33
33
|
|
34
34
|
expected_output = <<EOT
|
35
35
|
Shipping...
|
data/spec/system/rpm_spec.rb
CHANGED
@@ -29,7 +29,7 @@ describe "rpm" do
|
|
29
29
|
checkout_tar = File.expand_path("../data/red_herring-checkout-rpm.tar.gz", __FILE__)
|
30
30
|
@client.inject_tarball(checkout_tar)
|
31
31
|
|
32
|
-
@client.execute(["yes_ship_it.ruby2.
|
32
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
33
33
|
|
34
34
|
expected_output = <<EOT
|
35
35
|
Shipping...
|
@@ -30,7 +30,7 @@ describe "ship ruby gem" do
|
|
30
30
|
checkout_tar = File.expand_path("../data/red_herring-checkout-build.tar.gz", __FILE__)
|
31
31
|
@client.inject_tarball(checkout_tar)
|
32
32
|
|
33
|
-
@client.execute(["yes_ship_it.ruby2.
|
33
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
34
34
|
|
35
35
|
expect(@client.exit_code).to eq(0)
|
36
36
|
|
@@ -55,7 +55,7 @@ EOT
|
|
55
55
|
checkout_tar = File.expand_path("../data/red_herring-checkout-push.tar.gz", __FILE__)
|
56
56
|
@client.inject_tarball(checkout_tar)
|
57
57
|
|
58
|
-
@client.execute(["yes_ship_it.ruby2.
|
58
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
59
59
|
|
60
60
|
expect(@client.exit_code).to eq(0)
|
61
61
|
|
@@ -83,7 +83,7 @@ EOT
|
|
83
83
|
checkout_tar = File.expand_path("../data/red_herring-checkout-not-push.tar.gz", __FILE__)
|
84
84
|
@client.inject_tarball(checkout_tar)
|
85
85
|
|
86
|
-
@client.execute(["yes_ship_it.ruby2.
|
86
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
87
87
|
|
88
88
|
expect(@client.exit_code).to eq(0)
|
89
89
|
|
@@ -115,7 +115,7 @@ EOT
|
|
115
115
|
end
|
116
116
|
|
117
117
|
it "tells how to login" do
|
118
|
-
@client.execute(["yes_ship_it.ruby2.
|
118
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
119
119
|
|
120
120
|
expected_output = <<EOT
|
121
121
|
Shipping...
|
data/spec/unit/assertion_spec.rb
CHANGED
@@ -24,34 +24,36 @@ describe YSI::Assertion do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
describe "parameters" do
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
module YSI
|
28
|
+
class MyAssertion < Assertion
|
29
|
+
parameter :some_thing
|
30
|
+
parameter :some_other_thing, "default_hello"
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
def self.display_name
|
33
|
+
"My Assertion"
|
34
|
+
end
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
def check
|
37
|
+
end
|
37
38
|
|
38
|
-
|
39
|
+
def assert
|
40
|
+
end
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
42
44
|
it "has methods for parameter" do
|
43
|
-
my = MyAssertion.new(YSI::Engine.new)
|
45
|
+
my = YSI::MyAssertion.new(YSI::Engine.new)
|
44
46
|
my.some_thing = "hello"
|
45
47
|
expect(my.some_thing).to eq("hello")
|
46
48
|
end
|
47
49
|
|
48
50
|
it "has default value for parameter" do
|
49
|
-
my = MyAssertion.new(YSI::Engine.new)
|
51
|
+
my = YSI::MyAssertion.new(YSI::Engine.new)
|
50
52
|
expect(my.some_other_thing).to eq("default_hello")
|
51
53
|
end
|
52
54
|
|
53
55
|
it "returns nil when parameter is not set" do
|
54
|
-
my = MyAssertion.new(YSI::Engine.new)
|
56
|
+
my = YSI::MyAssertion.new(YSI::Engine.new)
|
55
57
|
expect(my.some_thing).to be(nil)
|
56
58
|
end
|
57
59
|
|
@@ -2,7 +2,7 @@ require_relative "../spec_helper.rb"
|
|
2
2
|
|
3
3
|
describe YSI::ReleaseBranch do
|
4
4
|
describe "#current_branch" do
|
5
|
-
it "finds current non-
|
5
|
+
it "finds current non-release branch" do
|
6
6
|
a = YSI::ReleaseBranch.new(YSI::Engine)
|
7
7
|
|
8
8
|
allow(a).to receive(:git_branch).and_return(" master\n* otherone\n")
|
@@ -10,7 +10,7 @@ describe YSI::ReleaseBranch do
|
|
10
10
|
expect(a.current_branch).to eq("otherone")
|
11
11
|
end
|
12
12
|
|
13
|
-
it "finds current
|
13
|
+
it "finds current release branch" do
|
14
14
|
a = YSI::ReleaseBranch.new(YSI::Engine)
|
15
15
|
|
16
16
|
allow(a).to receive(:git_branch).and_return("* master\n otherone\n")
|
@@ -18,12 +18,26 @@ describe YSI::ReleaseBranch do
|
|
18
18
|
expect(a.current_branch).to eq("master")
|
19
19
|
end
|
20
20
|
|
21
|
-
it "finds current
|
21
|
+
it "finds current release branch if it's the only branch" do
|
22
22
|
a = YSI::ReleaseBranch.new(YSI::Engine)
|
23
23
|
|
24
24
|
allow(a).to receive(:git_branch).and_return("* master\n")
|
25
25
|
|
26
26
|
expect(a.current_branch).to eq("master")
|
27
27
|
end
|
28
|
+
|
29
|
+
it "reads branch parameter" do
|
30
|
+
config = <<~YAML
|
31
|
+
assertions:
|
32
|
+
release_branch:
|
33
|
+
branch: main
|
34
|
+
version:
|
35
|
+
version_file: lib/version.rb
|
36
|
+
YAML
|
37
|
+
engine = YSI::Engine.new
|
38
|
+
engine.read_config(config)
|
39
|
+
|
40
|
+
expect(engine.assertions.first.branch).to eq("main")
|
41
|
+
end
|
28
42
|
end
|
29
43
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative "../spec_helper"
|
2
|
+
|
3
|
+
describe YSI::Tag do
|
4
|
+
describe "#get_tag_date" do
|
5
|
+
it "gets tag date" do
|
6
|
+
engine = YSI::Engine.new
|
7
|
+
engine.version = "0.0.2"
|
8
|
+
tag = YSI::Tag.new(engine)
|
9
|
+
|
10
|
+
executor = double
|
11
|
+
expect(executor).to receive(:run_command).with(["git", "show", "v0.0.2"]).
|
12
|
+
and_return("Date: Tue Jul 14 01:13:16 2015 +0200")
|
13
|
+
|
14
|
+
tag.get_tag_date(executor)
|
15
|
+
|
16
|
+
expect(engine.tag_date).to eq(Time.parse("20150713T231316Z"))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "#check" do
|
21
|
+
it "gets an existing tag" do
|
22
|
+
expect_any_instance_of(YSI::Executor).to receive(:run_command).
|
23
|
+
with(["git", "tag"]).and_return("v0.0.1\nv0.0.2\n")
|
24
|
+
|
25
|
+
engine = YSI::Engine.new
|
26
|
+
engine.version = "0.0.2"
|
27
|
+
tag = YSI::Tag.new(engine)
|
28
|
+
|
29
|
+
expect(tag).to receive(:get_tag_date)
|
30
|
+
|
31
|
+
tag.check
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "#assert" do
|
36
|
+
it "creates a tag" do
|
37
|
+
engine = YSI::Engine.new
|
38
|
+
engine.version = "0.0.2"
|
39
|
+
tag = YSI::Tag.new(engine)
|
40
|
+
|
41
|
+
executor = double
|
42
|
+
expect(executor).to receive(:run_command).
|
43
|
+
with(["git", "tag", "-a", "v0.0.2", "-m", "0.0.2"])
|
44
|
+
expect(tag).to receive(:get_tag_date)
|
45
|
+
|
46
|
+
tag.assert(executor)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -2,6 +2,21 @@ require_relative "../spec_helper.rb"
|
|
2
2
|
|
3
3
|
describe YSI::WorkingDirectory do
|
4
4
|
describe "#status" do
|
5
|
+
context "git 2.12.0" do
|
6
|
+
it "clean" do
|
7
|
+
a = YSI::WorkingDirectory.new(YSI::Engine)
|
8
|
+
|
9
|
+
git_output = <<EOT
|
10
|
+
On branch master
|
11
|
+
Your branch is up-to-date with 'origin/master'.
|
12
|
+
nothing to commit, working tree clean
|
13
|
+
EOT
|
14
|
+
allow(a).to receive(:git_status).and_return(git_output)
|
15
|
+
|
16
|
+
expect(a.status).to eq("clean")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
5
20
|
it "clean" do
|
6
21
|
a = YSI::WorkingDirectory.new(YSI::Engine)
|
7
22
|
|
@@ -17,8 +17,8 @@ describe YSI::YesItShipped do
|
|
17
17
|
}
|
18
18
|
EOT
|
19
19
|
stub_request(:get, "https://yes-it-shipped.herokuapp.com/releases/dummy/1.0.0").
|
20
|
-
with(:headers => {'Accept'=>'
|
21
|
-
|
20
|
+
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>/.*/, 'Host'=>'yes-it-shipped.herokuapp.com', 'User-Agent'=>/.*/}).
|
21
|
+
to_return(:status => 200, :body => body, :headers => {})
|
22
22
|
|
23
23
|
engine = YSI::Engine.new
|
24
24
|
allow(engine).to receive(:project_name).and_return("dummy")
|
@@ -29,8 +29,8 @@ EOT
|
|
29
29
|
|
30
30
|
it "fails when release is not there" do
|
31
31
|
stub_request(:get, "https://yes-it-shipped.herokuapp.com/releases/dummy/2.0.0").
|
32
|
-
with(:headers => {'Accept'=>'
|
33
|
-
|
32
|
+
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>/.*/, 'Host'=>'yes-it-shipped.herokuapp.com', 'User-Agent'=>/.*/}).
|
33
|
+
to_return(:status => 404, :body => "", :headers => {})
|
34
34
|
|
35
35
|
engine = YSI::Engine.new
|
36
36
|
allow(engine).to receive(:project_name).and_return("dummy")
|
@@ -53,11 +53,12 @@ EOT
|
|
53
53
|
"ysi_config_url"=>"https://raw.githubusercontent.com/cornelius/yes_ship_it/master/yes_ship_it.conf"
|
54
54
|
},
|
55
55
|
:headers => {
|
56
|
-
'Accept'=>'
|
57
|
-
'Accept-Encoding'=>
|
58
|
-
'Content-Length'=>'
|
56
|
+
'Accept'=>'*/*',
|
57
|
+
'Accept-Encoding'=> /.*/,
|
58
|
+
'Content-Length'=>'334',
|
59
59
|
'Content-Type'=>'application/x-www-form-urlencoded',
|
60
|
-
'
|
60
|
+
'Host'=>'yes-it-shipped.herokuapp.com',
|
61
|
+
'User-Agent' => /.*/
|
61
62
|
}).to_return(:status => 200, :body => "", :headers => {})
|
62
63
|
|
63
64
|
engine = YSI::Engine.new
|
@@ -71,4 +72,27 @@ EOT
|
|
71
72
|
expect(assertion.assert(engine.executor)).to eq("dummy-1.1.1")
|
72
73
|
end
|
73
74
|
end
|
75
|
+
|
76
|
+
it "reads yis_server_url parameter" do
|
77
|
+
config = <<EOT
|
78
|
+
assertions:
|
79
|
+
yes_it_shipped:
|
80
|
+
yis_server_url: http://localhost:3000
|
81
|
+
EOT
|
82
|
+
engine = YSI::Engine.new
|
83
|
+
engine.read_config(config)
|
84
|
+
|
85
|
+
expect(engine.assertions.first.yis_server_url).to eq("http://localhost:3000")
|
86
|
+
end
|
87
|
+
|
88
|
+
it "has default yis_server_url parameter" do
|
89
|
+
config = <<EOT
|
90
|
+
assertions:
|
91
|
+
yes_it_shipped:
|
92
|
+
EOT
|
93
|
+
engine = YSI::Engine.new
|
94
|
+
engine.read_config(config)
|
95
|
+
|
96
|
+
expect(engine.assertions.first.yis_server_url).to eq("https://yes-it-shipped.herokuapp.com")
|
97
|
+
end
|
74
98
|
end
|
data/spec/unit/executor_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe YSI::Executor do
|
|
6
6
|
describe "working directory" do
|
7
7
|
it "runs in the given working directory" do
|
8
8
|
working_directory = subject.run_command(["pwd"], working_directory: "/tmp")
|
9
|
-
expect(working_directory).to eq("/tmp\n")
|
9
|
+
expect(working_directory).to eq(File.join(path_prefix, "/tmp\n"))
|
10
10
|
end
|
11
11
|
|
12
12
|
it "sets back the working directory to the original value" do
|
data/yes_ship_it.gemspec
CHANGED
@@ -23,7 +23,8 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_development_dependency "given_filesystem"
|
24
24
|
s.add_development_dependency "cli_tester", ">= 0.0.2"
|
25
25
|
s.add_development_dependency "httpotemkin"
|
26
|
-
s.add_development_dependency "webmock"
|
26
|
+
s.add_development_dependency "webmock", "~> 2.1"
|
27
|
+
s.add_development_dependency "byebug"
|
27
28
|
|
28
29
|
s.files = `git ls-files`.split("\n")
|
29
30
|
s.require_path = 'lib'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yes_ship_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cornelius Schumacher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inifile
|
@@ -110,6 +110,20 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: webmock
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.1'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.1'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: byebug
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - ">="
|
@@ -132,9 +146,10 @@ extensions: []
|
|
132
146
|
extra_rdoc_files: []
|
133
147
|
files:
|
134
148
|
- ".codeclimate.yml"
|
149
|
+
- ".github/workflows/ruby.yml"
|
135
150
|
- ".gitignore"
|
136
151
|
- ".rspec"
|
137
|
-
- ".
|
152
|
+
- ".ruby-version"
|
138
153
|
- CHANGELOG.md
|
139
154
|
- Gemfile
|
140
155
|
- MIT-LICENSE
|
@@ -206,6 +221,7 @@ files:
|
|
206
221
|
- spec/unit/assertions/release_archive_spec.rb
|
207
222
|
- spec/unit/assertions/release_branch_spec.rb
|
208
223
|
- spec/unit/assertions/submitted_rpm_spec.rb
|
224
|
+
- spec/unit/assertions/tag_spec.rb
|
209
225
|
- spec/unit/assertions/version_spec.rb
|
210
226
|
- spec/unit/assertions/working_directory_spec.rb
|
211
227
|
- spec/unit/assertions/yes_it_shipped_spec.rb
|
@@ -241,10 +257,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
257
|
- !ruby/object:Gem::Version
|
242
258
|
version: 1.3.6
|
243
259
|
requirements: []
|
244
|
-
|
245
|
-
rubygems_version: 2.2.2
|
260
|
+
rubygems_version: 3.1.6
|
246
261
|
signing_key:
|
247
262
|
specification_version: 4
|
248
263
|
summary: The ultimate release script
|
249
264
|
test_files: []
|
250
|
-
has_rdoc:
|