Skip to content

Commit a8ee4db

Browse files
committed
Update tests
1 parent 1cb54aa commit a8ee4db

File tree

1 file changed

+54
-52
lines changed

1 file changed

+54
-52
lines changed

spec/errbit_plugin/issue_tracker_validator_spec.rb

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -48,58 +48,60 @@ def url
4848
end
4949
end
5050

51-
# context "with class not inherit from ErrbitPlugin::IssueTracker" do
52-
# klass = Class.new do
53-
# def self.label
54-
# "foo"
55-
# end
56-
#
57-
# def self.note
58-
# "foo"
59-
# end
60-
#
61-
# def self.fields
62-
# ["foo"]
63-
# end
64-
#
65-
# def self.icons
66-
# {}
67-
# end
68-
#
69-
# def initialize(params)
70-
# end
71-
#
72-
# def configured?
73-
# true
74-
# end
75-
#
76-
# def errors
77-
# true
78-
# end
79-
#
80-
# def create_issue
81-
# "http"
82-
# end
83-
#
84-
# def close_issue
85-
# "http"
86-
# end
87-
#
88-
# def url
89-
# "http"
90-
# end
91-
# end
92-
#
93-
# it "not valid" do
94-
# expect(ErrbitPlugin::IssueTrackerValidator.new(klass).valid?).to be false
95-
# end
96-
#
97-
# it "says :not_inherited" do
98-
# is = ErrbitPlugin::IssueTrackerValidator.new(klass)
99-
# is.valid?
100-
# expect(is.errors).to eql [[:not_inherited]]
101-
# end
102-
# end
51+
context "with class not inherit from ErrbitPlugin::IssueTracker" do
52+
klass = Class.new do
53+
def self.label
54+
"foo"
55+
end
56+
57+
def self.note
58+
"foo"
59+
end
60+
61+
def self.fields
62+
["foo"]
63+
end
64+
65+
def self.icons
66+
{}
67+
end
68+
69+
def initialize(*)
70+
end
71+
72+
def configured?
73+
true
74+
end
75+
76+
def errors
77+
true
78+
end
79+
80+
def create_issue
81+
"http"
82+
end
83+
84+
def close_issue
85+
"http"
86+
end
87+
88+
def url
89+
"http"
90+
end
91+
end
92+
93+
it "is not valid" do
94+
expect(ErrbitPlugin::IssueTrackerValidator.new(klass).valid?).to eq(false)
95+
end
96+
97+
it "says :not_inherited" do
98+
validator = ErrbitPlugin::IssueTrackerValidator.new(klass)
99+
100+
validator.valid?
101+
102+
expect(validator.errors).to eq([[:not_inherited]])
103+
end
104+
end
103105

104106
# context "with no label method" do
105107
# klass = Class.new(ErrbitPlugin::IssueTracker) do

0 commit comments

Comments
 (0)