Skip to content

Commit caa9f12

Browse files
committed
More tests
1 parent a8ee4db commit caa9f12

File tree

1 file changed

+47
-45
lines changed

1 file changed

+47
-45
lines changed

spec/errbit_plugin/issue_tracker_validator_spec.rb

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -103,51 +103,53 @@ def url
103103
end
104104
end
105105

106-
# context "with no label method" do
107-
# klass = Class.new(ErrbitPlugin::IssueTracker) do
108-
# def self.note
109-
# "foo"
110-
# end
111-
#
112-
# def self.fields
113-
# ["foo"]
114-
# end
115-
#
116-
# def self.icons
117-
# {}
118-
# end
119-
#
120-
# def configured?
121-
# true
122-
# end
123-
#
124-
# def errors
125-
# true
126-
# end
127-
#
128-
# def create_issue
129-
# "http"
130-
# end
131-
#
132-
# def close_issue
133-
# "http"
134-
# end
135-
#
136-
# def url
137-
# "http"
138-
# end
139-
# end
140-
#
141-
# it "not valid" do
142-
# expect(ErrbitPlugin::IssueTrackerValidator.new(klass).valid?).to be false
143-
# end
144-
#
145-
# it "say not implement label method" do
146-
# is = ErrbitPlugin::IssueTrackerValidator.new(klass)
147-
# is.valid?
148-
# expect(is.errors).to eql [[:class_method_missing, :label]]
149-
# end
150-
# end
106+
context "with no label method" do
107+
klass = Class.new(ErrbitPlugin::IssueTracker) do
108+
def self.note
109+
"foo"
110+
end
111+
112+
def self.fields
113+
["foo"]
114+
end
115+
116+
def self.icons
117+
{}
118+
end
119+
120+
def configured?
121+
true
122+
end
123+
124+
def errors
125+
true
126+
end
127+
128+
def create_issue
129+
"http"
130+
end
131+
132+
def close_issue
133+
"http"
134+
end
135+
136+
def url
137+
"http"
138+
end
139+
end
140+
141+
it "is not valid" do
142+
expect(ErrbitPlugin::IssueTrackerValidator.new(klass).valid?).to eq(false)
143+
end
144+
145+
it "say not implement label method" do
146+
validator = ErrbitPlugin::IssueTrackerValidator.new(klass)
147+
148+
validator.valid?
149+
150+
expect(validator.errors).to eq([[:class_method_missing, :label]])
151+
end
152+
end
151153

152154
# context "with no icons method" do
153155
# klass = Class.new(ErrbitPlugin::IssueTracker) do

0 commit comments

Comments
 (0)