shard-ameba/spec/ameba/issue_spec.cr

51 lines
1.2 KiB
Crystal
Raw Normal View History

2018-06-10 21:15:12 +00:00
require "../spec_helper"
module Ameba
describe Issue do
it "accepts rule and message" do
issue = Issue.new rule: DummyRule.new,
location: nil,
end_location: nil,
message: "Blah",
status: nil
issue.rule.should_not be_nil
issue.message.should eq "Blah"
end
it "accepts location" do
location = Crystal::Location.new("path", 3, 2)
issue = Issue.new rule: DummyRule.new,
location: location,
end_location: nil,
message: "Blah",
status: nil
issue.location.to_s.should eq location.to_s
issue.end_location.should eq nil
end
it "accepts end_location" do
location = Crystal::Location.new("path", 3, 2)
issue = Issue.new rule: DummyRule.new,
location: nil,
end_location: location,
message: "Blah",
status: nil
issue.location.should eq nil
issue.end_location.to_s.should eq location.to_s
end
it "accepts status" do
issue = Issue.new rule: DummyRule.new,
location: nil,
end_location: nil,
message: "",
status: :enabled
issue.status.should eq :enabled
end
end
end