github-pr 0.0.7 → 0.0.8
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/lib/github-pr/runner.rb +1 -1
- data/lib/github-pr/token.rb +2 -2
- data/test/test_github-pr.rb +21 -19
- data/test/test_token.rb +16 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a48924fe0e7d60533b3fb3404b7284e0b0f7a1b
|
4
|
+
data.tar.gz: 22945ebc5e2c21660d71358b281fcfffb0b17898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7281c16c629562b85b9e36991180476f5afceb670ce90c5212440b9906190f0feaf1aff438d511694f6953cfaaadc8fc08fd9ab4fdd96625b036c26e3647150
|
7
|
+
data.tar.gz: b0588cd9c483ef97fa1c85451d0dcdde4b2a4d442b98b6e9de6666ada4fc2587c15412714e5d9b66f5aba941aa15cafffad7f77b4c590b863492ba8584ae7b62
|
data/lib/github-pr/runner.rb
CHANGED
data/lib/github-pr/token.rb
CHANGED
@@ -7,10 +7,10 @@ require 'fileutils'
|
|
7
7
|
module GitHubPr
|
8
8
|
class Token
|
9
9
|
|
10
|
-
self.create(token_file_path)
|
10
|
+
def self.create(token_file_path)
|
11
11
|
env_token = `echo $GITHUB_TOKEN`
|
12
12
|
|
13
|
-
|
13
|
+
env_token.nil? ? FileToken.new(token_file_path) : FixedToken.new(env_token.strip)
|
14
14
|
end
|
15
15
|
|
16
16
|
def get(regenerate: regenerate = false)
|
data/test/test_github-pr.rb
CHANGED
@@ -1,31 +1,33 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
|
-
require 'github-pr'
|
3
|
-
|
4
|
-
describe
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
require 'github-pr/cli'
|
3
|
+
module GitHubPr
|
4
|
+
describe CLI do
|
5
|
+
|
6
|
+
describe "when passed only assigner" do
|
7
|
+
it "must contain assign field" do
|
8
|
+
CLI.parse(['-a', 'hovox'])[:assign].must_equal 'hovox'
|
9
|
+
end
|
9
10
|
end
|
10
|
-
end
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
describe "when does not passed assigner argument" do
|
13
|
+
it "must raise an runtime error" do
|
14
|
+
-> { CLI.parse(['-b', 'master', '-f', 'shop']) }.must_raise RuntimeError
|
15
|
+
end
|
15
16
|
end
|
16
|
-
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
describe "when does not passed base branch" do
|
19
|
+
it "must take master as base branch" do
|
20
|
+
CLI.parse(['-a', 'hovox'])[:base].must_equal 'master'
|
21
|
+
end
|
21
22
|
end
|
22
|
-
end
|
23
23
|
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
describe "when does not passed base branch" do
|
26
|
+
it "must take master as base branch" do
|
27
|
+
CLI.parse(['-a', 'hovox'])[:base].must_equal 'master'
|
28
|
+
end
|
28
29
|
end
|
30
|
+
|
29
31
|
end
|
30
32
|
|
31
33
|
end
|
data/test/test_token.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hovhannes Safaryan
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- lib/github-pr/runner.rb
|
53
53
|
- lib/github-pr/token.rb
|
54
54
|
- test/test_github-pr.rb
|
55
|
+
- test/test_token.rb
|
55
56
|
homepage: http://rubygems.org/gems/github-pr
|
56
57
|
licenses:
|
57
58
|
- MIT
|