party_foul 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/party_foul/exception_handler.rb +1 -1
- data/lib/party_foul/version.rb +1 -1
- data/test/generator_test.rb +1 -1
- data/test/party_foul/exception_handler_test.rb +14 -14
- data/test/test_helper.rb +4 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2e2c7c88016cdd88cc41490e510338bbfae26cb
|
4
|
+
data.tar.gz: 84851ff00f7e36dec4797dce9c9a5cd676b1ab2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cd78f2f92ec77ddd1c54bd3f7843205a4baa1c003645ea295847ae930e11761bc54a6df60c4798cd21952b85f46ce41235b439df2b10c4c99bf96c5f3b6fae7
|
7
|
+
data.tar.gz: 75285db4affef7d2445a2c375d37b1d81f9752c41af1c0e00f311ff64925d2e47fdf8c6bb6a237c74167d6aceb780d03207db72031f8813280368d58183ecd66
|
@@ -91,6 +91,6 @@ class PartyFoul::ExceptionHandler
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def find_first_issue(state)
|
94
|
-
PartyFoul.github.search_issues(fingerprint
|
94
|
+
PartyFoul.github.search_issues("#{fingerprint} repo:#{PartyFoul.repo_path} state:#{state}").items.first
|
95
95
|
end
|
96
96
|
end
|
data/lib/party_foul/version.rb
CHANGED
data/test/generator_test.rb
CHANGED
@@ -12,7 +12,7 @@ class PartyFoul::GeneratorTest < Rails::Generators::TestCase
|
|
12
12
|
octokit = mock('Octokit::Client')
|
13
13
|
octokit.expects(:create_authorization).with(scopes: ['repo'], note: 'PartyFoul test_owner/test_repo', note_url: 'http://example.com/test_owner/test_repo').returns(sawyer_resource({token: 'test_token'}))
|
14
14
|
Octokit::Client.stubs(:new).with(:login => 'test_login', :password => 'test_password', :api_endpoint => 'http://api.example.com').returns(octokit)
|
15
|
-
|
15
|
+
::Readline.stubs(:readline).returns('test_login').then.returns('test_password').then.returns(owner).then.returns(repo).then.returns('http://api.example.com').then.returns('http://example.com').then.returns('')
|
16
16
|
run_generator
|
17
17
|
|
18
18
|
assert_file 'config/initializers/party_foul.rb' do |initializer|
|
@@ -17,8 +17,8 @@ describe 'Party Foul Exception Handler' do
|
|
17
17
|
it 'will open a new error on GitHub' do
|
18
18
|
PartyFoul::IssueRenderers::Rails.any_instance.stubs(:body).returns('Test Body')
|
19
19
|
PartyFoul::IssueRenderers::Rails.any_instance.stubs(:comment).returns('Test Comment')
|
20
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
21
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
20
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:open').returns(no_search_results)
|
21
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:closed').returns(no_search_results)
|
22
22
|
PartyFoul.github.expects(:create_issue).with('test_owner/test_repo', 'Test Title', 'Test Body', labels: ['bug']).returns( {number: 1} )
|
23
23
|
PartyFoul.github.expects(:references).with('test_owner/test_repo', 'heads/deploy').returns( sawyer_resource({object: {sha: 'abcdefg1234567890'}}) )
|
24
24
|
PartyFoul.github.expects(:add_comment).with('test_owner/test_repo', 1, 'Test Comment')
|
@@ -37,8 +37,8 @@ describe 'Party Foul Exception Handler' do
|
|
37
37
|
it 'will open a new error on GitHub with the additional labels' do
|
38
38
|
PartyFoul::IssueRenderers::Rails.any_instance.stubs(:body).returns('Test Body')
|
39
39
|
PartyFoul::IssueRenderers::Rails.any_instance.stubs(:comment).returns('Test Comment')
|
40
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
41
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
40
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:open').returns(no_search_results)
|
41
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:closed').returns(no_search_results)
|
42
42
|
PartyFoul.github.expects(:create_issue).with('test_owner/test_repo', 'Test Title', 'Test Body', :labels => ['bug', 'custom', 'label']).returns( { number: 1 } )
|
43
43
|
PartyFoul.github.expects(:references).with('test_owner/test_repo', 'heads/deploy').returns( sawyer_resource({object: {sha: 'abcdefg1234567890'}}) )
|
44
44
|
PartyFoul.github.expects(:add_comment).with('test_owner/test_repo', 1, 'Test Comment')
|
@@ -59,8 +59,8 @@ describe 'Party Foul Exception Handler' do
|
|
59
59
|
end
|
60
60
|
PartyFoul::IssueRenderers::Rails.any_instance.stubs(:body).returns('Test Body')
|
61
61
|
PartyFoul::IssueRenderers::Rails.any_instance.stubs(:comment).returns('Test Comment')
|
62
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
63
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
62
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:open').returns(no_search_results)
|
63
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:closed').returns(no_search_results)
|
64
64
|
PartyFoul.github.expects(:references).with('test_owner/test_repo', 'heads/deploy').returns( sawyer_resource({object: {sha: 'abcdefg1234567890'}}) )
|
65
65
|
PartyFoul.github.expects(:add_comment).with('test_owner/test_repo', 1, 'Test Comment')
|
66
66
|
end
|
@@ -93,8 +93,8 @@ describe 'Party Foul Exception Handler' do
|
|
93
93
|
|
94
94
|
context 'and open' do
|
95
95
|
before do
|
96
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
97
|
-
|
96
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:open').returns(
|
97
|
+
sawyer_resource({total_count: 1, incomplete_results: false, items:[{title: 'Test Title', body: 'Test Body', state: 'open', number: 1}]}) )
|
98
98
|
PartyFoul.github.expects(:update_issue).with('test_owner/test_repo', 1, 'Test Title', 'New Body', state: 'open')
|
99
99
|
PartyFoul.github.expects(:references).with('test_owner/test_repo', 'heads/deploy').returns(
|
100
100
|
sawyer_resource({object: {sha: 'abcdefg1234567890'}}) )
|
@@ -117,9 +117,9 @@ describe 'Party Foul Exception Handler' do
|
|
117
117
|
|
118
118
|
context 'and closed' do
|
119
119
|
it 'will update the count on the body and re-open the issue' do
|
120
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
121
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
122
|
-
|
120
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:open').returns(no_search_results)
|
121
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:closed').returns(
|
122
|
+
sawyer_resource({total_count: 1, incomplete_results: false, items:[{title: 'Test Title', body: 'Test Body', state: 'closed', number: 1, labels: ['staging']}]}) )
|
123
123
|
PartyFoul.github.expects(:update_issue).with('test_owner/test_repo', 1, 'Test Title', 'New Body', state: 'open', labels: ['bug', 'regression', 'staging'])
|
124
124
|
PartyFoul.github.expects(:add_comment).with('test_owner/test_repo', 1, 'Test Comment')
|
125
125
|
PartyFoul.github.expects(:references).with('test_owner/test_repo', 'heads/deploy').returns(sawyer_resource({object: {sha: 'abcdefg1234567890'}}))
|
@@ -131,9 +131,9 @@ describe 'Party Foul Exception Handler' do
|
|
131
131
|
context 'when issue is marked as "wontfix"' do
|
132
132
|
it 'does nothing' do
|
133
133
|
PartyFoul::IssueRenderers::Rails.any_instance.stubs(:body).returns('Test Body')
|
134
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
135
|
-
PartyFoul.github.expects(:search_issues).with('test_fingerprint
|
136
|
-
|
134
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:open').returns(no_search_results)
|
135
|
+
PartyFoul.github.expects(:search_issues).with('test_fingerprint repo:test_owner/test_repo state:closed').returns(
|
136
|
+
sawyer_resource({total_count: 1, incomplete_results: false, items:[{title: 'Test Title', body: 'Test Body', state: 'closed', number: 1, labels: ['wontfix']}]}) )
|
137
137
|
PartyFoul.github.expects(:create_issue).never
|
138
138
|
PartyFoul.github.expects(:update_issue).never
|
139
139
|
PartyFoul.github.expects(:add_comment).never
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: party_foul
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Cardarella
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: octokit
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '3.1'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '3.1'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: actionpack
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|