Browse files

Firstly add kind to the issue

The kinds must be added to the issues
  • Loading branch information...
1 parent ade127f commit e24ac522a168a70b8af872a68457f0bc7fb581b1 @davidakachaos committed May 11, 2012
Showing with 9 additions and 3 deletions.
  1. +3 −2 lib/preflight/issue.rb
  2. +6 −1 spec/issue_spec.rb
View
5 lib/preflight/issue.rb
@@ -3,10 +3,11 @@
module Preflight
class Issue
- attr_reader :description, :rule, :attributes
+ attr_reader :description, :rule, :attributes, :kind
- def initialize(description, rule, attributes = {})
+ def initialize(description, rule, attributes = {}, kind = :error)
@description = description
+ @kind = kind
if rule.is_a?(Class)
@rule = rule.to_s.to_sym
else
View
7 spec/issue_spec.rb
@@ -6,7 +6,8 @@
let!(:issue) do
Preflight::Issue.new("Transparency detected",
Preflight::Rules::NoTransparency,
- {:page => 1}
+ {:page => 1},
+ :error
)
end
@@ -26,6 +27,10 @@
issue.page.should == 1
end
+ it "should return the kind as a symbol" do
+ issue.kind.should == :error
+ end
+
it "should return true to a respond_to? call" do
issue.respond_to?(:page).should be_true
end

0 comments on commit e24ac52

Please sign in to comment.