github-pr 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ed6bc373e77867f07cfbfb2e0e2079da0e54e77
4
- data.tar.gz: 7b36f90ce9ef15c7f7ea19899b61de59520dca2b
3
+ metadata.gz: 4a48924fe0e7d60533b3fb3404b7284e0b0f7a1b
4
+ data.tar.gz: 22945ebc5e2c21660d71358b281fcfffb0b17898
5
5
  SHA512:
6
- metadata.gz: d6bb40a9302acf1a4e2970e44ec8e4bf4ab22fe1cfa4a9880be167d15efdb4263f9d9e5f481d2482168189622ecdcc731893047593ad4af2cb98bf369198343c
7
- data.tar.gz: 601973fb98c1f483098ac6926b77d85ab2446ae7f6a30ba7c73441d98660cc5650fdf9a6c4962bc480937c52dd6edec8d7cfdeb67f0f35ae4a3c54523fcc9e54
6
+ metadata.gz: f7281c16c629562b85b9e36991180476f5afceb670ce90c5212440b9906190f0feaf1aff438d511694f6953cfaaadc8fc08fd9ab4fdd96625b036c26e3647150
7
+ data.tar.gz: b0588cd9c483ef97fa1c85451d0dcdde4b2a4d442b98b6e9de6666ada4fc2587c15412714e5d9b66f5aba941aa15cafffad7f77b4c590b863492ba8584ae7b62
@@ -5,7 +5,7 @@ module GitHubPr
5
5
  options = CLI.parse(opts)
6
6
  puts options
7
7
 
8
- poster = Poster.new(Token.create(File.expand_path '~/.config/gh-pr-token'))
8
+ poster = Poster.new(FileToken.create(File.expand_path '~/.config/gh-pr-token'))
9
9
  poster.post(options)
10
10
  end
11
11
  end
@@ -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
- return env_token.nil? ? FileToken.new(token_file_path) : FixedToken.new(env_token.strip)
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)
@@ -1,31 +1,33 @@
1
1
  require 'minitest/autorun'
2
- require 'github-pr'
3
-
4
- describe GitHubPr do
5
-
6
- describe "when passed only assigner" do
7
- it "must contain assign field" do
8
- GitHubPr.parse(['-a', 'hovox'])[:assign].must_equal 'hovox'
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
- describe "when does not passed assigner argument" do
13
- it "must raise an runtime error" do
14
- -> { GitHubPr.parse(['-b', 'master', '-f', 'shop']) }.must_raise RuntimeError
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
- describe "when does not passed base branch" do
19
- it "must take master as base branch" do
20
- GitHubPr.parse(['-a', 'hovox'])[:base].must_equal 'master'
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
- describe "when does not passed base branch" do
26
- it "must take master as base branch" do
27
- GitHubPr.parse(['-a', 'hovox'])[:base].must_equal 'master'
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
@@ -0,0 +1,16 @@
1
+ require 'minitest/autorun'
2
+ require 'github-pr/token'
3
+
4
+ module GitHubPr
5
+
6
+ describe Token do
7
+ describe "just build test" do
8
+ it "must pass if builds" do
9
+ "aaa".must_equal "aaa"
10
+ end
11
+ end
12
+
13
+
14
+ end
15
+
16
+ end
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.7
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