errbit_plugin 0.1.0 → 0.2.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/lib/errbit_plugin.rb +1 -1
- data/lib/errbit_plugin/{register_plugin.rb → registry.rb} +4 -0
- data/lib/errbit_plugin/version.rb +1 -1
- data/spec/errbit_plugin/{register_plugin_spec.rb → registry_spec.rb} +23 -14
- data/spec/errbit_plugin/validate_issue_tracker_spec.rb +12 -12
- 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: 4d05454acc287bd01a03cc51cc416ecacecd7abd
|
4
|
+
data.tar.gz: 10b79b6950d22e639c8a08cc69c4bcee94fde6af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f4ef882ae3e1ffc5f3ecde93339d7f032c52a19d58d5e0ee29dee621a2ef4c48a245ed8993b5b7e758bbc865bd4390e00140830db351335ff1860eb9583a8dc
|
7
|
+
data.tar.gz: 0da44f3a335b6fa3b1e44e1e5ff47b2daf5a88b7085e0cbc38d8ef9159cfe30f11be229ca739dad982fc4fa324e2e075893bcaa97836627c0d22426cfbd5c0d1
|
data/lib/errbit_plugin.rb
CHANGED
@@ -1,30 +1,39 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe ErrbitPlugin::
|
3
|
+
describe ErrbitPlugin::Registry do
|
4
4
|
before do
|
5
|
-
ErrbitPlugin::
|
5
|
+
ErrbitPlugin::Registry.clear_issue_trackers
|
6
6
|
end
|
7
7
|
|
8
|
+
let(:tracker) {
|
9
|
+
tracker = Class.new(ErrbitPlugin::IssueTracker) do
|
10
|
+
def self.label
|
11
|
+
'something'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
tracker
|
15
|
+
}
|
16
|
+
|
8
17
|
describe ".add_issue_tracker" do
|
9
18
|
context "with issue_tracker class valid" do
|
10
19
|
before do
|
11
20
|
allow(ErrbitPlugin::ValidateIssueTracker)
|
12
21
|
.to receive(:new)
|
13
|
-
.with(
|
22
|
+
.with(tracker)
|
14
23
|
.and_return(double(:valid? => true, :message => ''))
|
15
24
|
end
|
16
25
|
it 'add new issue_tracker plugin' do
|
17
|
-
ErrbitPlugin::
|
18
|
-
expect(ErrbitPlugin::
|
19
|
-
'
|
26
|
+
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
27
|
+
expect(ErrbitPlugin::Registry.issue_trackers).to eq({
|
28
|
+
'something' => tracker
|
20
29
|
})
|
21
30
|
end
|
22
31
|
context "with already issue_tracker with this key" do
|
23
|
-
it 'raise ErrbitPlugin::
|
24
|
-
ErrbitPlugin::
|
32
|
+
it 'raise ErrbitPlugin::AlreadyRegisteredError' do
|
33
|
+
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
25
34
|
expect {
|
26
|
-
ErrbitPlugin::
|
27
|
-
}.to raise_error(ErrbitPlugin::
|
35
|
+
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
36
|
+
}.to raise_error(ErrbitPlugin::AlreadyRegisteredError)
|
28
37
|
end
|
29
38
|
end
|
30
39
|
end
|
@@ -33,21 +42,21 @@ describe ErrbitPlugin::Register do
|
|
33
42
|
it 'raise an IncompatibilityError' do
|
34
43
|
allow(ErrbitPlugin::ValidateIssueTracker)
|
35
44
|
.to receive(:new)
|
36
|
-
.with(
|
45
|
+
.with(tracker)
|
37
46
|
.and_return(double(:valid? => false, :message => 'foo', :errors => []))
|
38
47
|
expect {
|
39
|
-
ErrbitPlugin::
|
48
|
+
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
40
49
|
}.to raise_error(ErrbitPlugin::IncompatibilityError)
|
41
50
|
end
|
42
51
|
|
43
52
|
it 'puts the errors in the exception message' do
|
44
53
|
allow(ErrbitPlugin::ValidateIssueTracker)
|
45
54
|
.to receive(:new)
|
46
|
-
.with(
|
55
|
+
.with(tracker)
|
47
56
|
.and_return(double(:valid? => false, :message => 'foo', :errors => ['one', 'two']))
|
48
57
|
|
49
58
|
begin
|
50
|
-
ErrbitPlugin::
|
59
|
+
ErrbitPlugin::Registry.add_issue_tracker(tracker)
|
51
60
|
rescue ErrbitPlugin::IncompatibilityError => e
|
52
61
|
expect(e.message).to eq('one; two')
|
53
62
|
end
|
@@ -9,7 +9,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
9
9
|
def self.note; 'foo'; end
|
10
10
|
def self.fields; ['foo']; end
|
11
11
|
def configured?; true; end
|
12
|
-
def
|
12
|
+
def errors; true; end
|
13
13
|
def create_issue; 'http'; end
|
14
14
|
def url; 'http'; end
|
15
15
|
def comments_allowed?; false; end
|
@@ -27,7 +27,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
27
27
|
def self.note; 'foo'; end
|
28
28
|
def self.fields; ['foo']; end
|
29
29
|
def configured?; true; end
|
30
|
-
def
|
30
|
+
def errors; true; end
|
31
31
|
def create_issue; 'http'; end
|
32
32
|
def url; 'http'; end
|
33
33
|
def comments_allowed?; false; end
|
@@ -49,7 +49,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
49
49
|
def note; 'foo'; end
|
50
50
|
def fields; ['foo']; end
|
51
51
|
def configured?; true; end
|
52
|
-
def
|
52
|
+
def errors; true; end
|
53
53
|
def create_issue; 'http'; end
|
54
54
|
def url; 'http'; end
|
55
55
|
def comments_allowed?; false; end
|
@@ -71,7 +71,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
71
71
|
def self.label; 'foo'; end
|
72
72
|
def note; 'foo'; end
|
73
73
|
def configured?; true; end
|
74
|
-
def
|
74
|
+
def errors; true; end
|
75
75
|
def create_issue; 'http'; end
|
76
76
|
def url; 'http'; end
|
77
77
|
def comments_allowed?; false; end
|
@@ -93,7 +93,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
93
93
|
def label; 'foo'; end
|
94
94
|
def note; 'foo'; end
|
95
95
|
def fields; ['foo']; end
|
96
|
-
def
|
96
|
+
def errors; true; end
|
97
97
|
def create_issue; 'http'; end
|
98
98
|
def url; 'http'; end
|
99
99
|
def comments_allowed?; false; end
|
@@ -110,7 +110,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
context "without
|
113
|
+
context "without errors method" do
|
114
114
|
class BazCheckParams < ErrbitPlugin::IssueTracker
|
115
115
|
def label; 'foo'; end
|
116
116
|
def note; 'foo'; end
|
@@ -125,10 +125,10 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
125
125
|
expect(ErrbitPlugin::ValidateIssueTracker.new(BazCheckParams).valid?).to be false
|
126
126
|
end
|
127
127
|
|
128
|
-
it 'say not implement
|
128
|
+
it 'say not implement errors' do
|
129
129
|
is = ErrbitPlugin::ValidateIssueTracker.new(BazCheckParams)
|
130
130
|
is.valid?
|
131
|
-
expect(is.errors).to eql [[:instance_method_missing, :
|
131
|
+
expect(is.errors).to eql [[:instance_method_missing, :errors]]
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
@@ -138,7 +138,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
138
138
|
def note; 'foo'; end
|
139
139
|
def fields; ['foo']; end
|
140
140
|
def configured?; true; end
|
141
|
-
def
|
141
|
+
def errors; true; end
|
142
142
|
def url; 'http'; end
|
143
143
|
def comments_allowed?; false; end
|
144
144
|
end
|
@@ -159,7 +159,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
159
159
|
def note; 'foo'; end
|
160
160
|
def fields; ['foo']; end
|
161
161
|
def configured?; true; end
|
162
|
-
def
|
162
|
+
def errors; true; end
|
163
163
|
def create_issue; 'http'; end
|
164
164
|
def comments_allowed?; false; end
|
165
165
|
end
|
@@ -181,7 +181,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
181
181
|
def note; 'foo'; end
|
182
182
|
def fields; ['foo']; end
|
183
183
|
def configured?; true; end
|
184
|
-
def
|
184
|
+
def errors; true; end
|
185
185
|
def create_issue; 'http'; end
|
186
186
|
def url; 'foo'; end
|
187
187
|
end
|
@@ -202,7 +202,7 @@ describe ErrbitPlugin::ValidateIssueTracker do
|
|
202
202
|
def self.label; 'foo'; end
|
203
203
|
def self.fields; ['foo']; end
|
204
204
|
def configured?; true; end
|
205
|
-
def
|
205
|
+
def errors; true; end
|
206
206
|
def create_issue; 'http'; end
|
207
207
|
def url; 'foo'; end
|
208
208
|
def comments_allowed?; false; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: errbit_plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Crosby
|
@@ -60,10 +60,10 @@ files:
|
|
60
60
|
- lib/errbit_plugin/issue_trackers/fake.rb
|
61
61
|
- lib/errbit_plugin/issue_trackers/none.rb
|
62
62
|
- lib/errbit_plugin/rails.rb
|
63
|
-
- lib/errbit_plugin/
|
63
|
+
- lib/errbit_plugin/registry.rb
|
64
64
|
- lib/errbit_plugin/validate_issue_tracker.rb
|
65
65
|
- lib/errbit_plugin/version.rb
|
66
|
-
- spec/errbit_plugin/
|
66
|
+
- spec/errbit_plugin/registry_spec.rb
|
67
67
|
- spec/errbit_plugin/validate_issue_tracker_spec.rb
|
68
68
|
- spec/spec_helper.rb
|
69
69
|
- vendor/assets/images/fake_create.png
|
@@ -95,7 +95,7 @@ signing_key:
|
|
95
95
|
specification_version: 4
|
96
96
|
summary: Base to create an errbit plugin
|
97
97
|
test_files:
|
98
|
-
- spec/errbit_plugin/
|
98
|
+
- spec/errbit_plugin/registry_spec.rb
|
99
99
|
- spec/errbit_plugin/validate_issue_tracker_spec.rb
|
100
100
|
- spec/spec_helper.rb
|
101
101
|
has_rdoc:
|