Skip to content

Commit

Permalink
Crystal 0.24.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
veelenga committed Dec 26, 2017
1 parent eca0d28 commit 7e8703d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 181 deletions.
2 changes: 1 addition & 1 deletion spec/ameba/rule/base_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "../../spec/spec_helper"
require "../../spec_helper"

module Ameba
describe Rule::Base do
Expand Down
118 changes: 0 additions & 118 deletions spec/ameba/rule/duplicated_when_spec.cr

This file was deleted.

2 changes: 1 addition & 1 deletion spec/ameba/rule/empty_expression_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module Ameba
error = s.errors.first
error.rule.should_not be_nil
error.location.to_s.should eq "source.cr:2:12"
error.message.should eq "Avoid empty expression '()'"
error.message.should eq "Avoid empty expressions"
end
end
end
3 changes: 2 additions & 1 deletion spec/ameba/rule/shadowed_exception_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,15 @@ module Ameba::Rule
it "reports rule, location and a message" do
s = Source.new %q(
begin
do_something
rescue Exception | IndexError
end
), "source.cr"
subject.catch(s).should_not be_valid
error = s.errors.first

error.rule.should_not be_nil
error.location.to_s.should eq "source.cr:2:9"
error.location.to_s.should eq "source.cr:3:11"
error.message.should eq(
"Exception handler has shadowed exceptions: IndexError"
)
Expand Down
13 changes: 8 additions & 5 deletions src/ameba/formatter/todo_formatter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ module Ameba::Formatter
.compact
.uniq!

YAML.build do |yaml|
yaml.mapping do
rule.name.to_yaml(yaml)
rule.to_yaml(yaml)
end
nodes_builder = YAML::Nodes::Builder.new
nodes_builder.mapping do
rule.name.to_yaml nodes_builder
rule.to_yaml nodes_builder
end

YAML.build do |builder|
nodes_builder.document.to_yaml(builder)
end
end
end
Expand Down
55 changes: 0 additions & 55 deletions src/ameba/rule/duplicated_when.cr

This file was deleted.

0 comments on commit 7e8703d

Please sign in to comment.