diff --git a/src/spectator/example_group.cr b/src/spectator/example_group.cr index 872ca80..308ad91 100644 --- a/src/spectator/example_group.cr +++ b/src/spectator/example_group.cr @@ -17,11 +17,11 @@ module Spectator end def examples : Enumerable(Example) - children.compact_map { |child| child.as?(Example) } + children.compact_map &.as?(Example) end def groups : Enumerable(ExampleGroup) - children.compact_map { |child| child.as?(ExampleGroup) } + children.compact_map &.as?(ExampleGroup) end def example_count diff --git a/src/spectator/example_hooks.cr b/src/spectator/example_hooks.cr index 488a754..3f35c8d 100644 --- a/src/spectator/example_hooks.cr +++ b/src/spectator/example_hooks.cr @@ -20,19 +20,19 @@ module Spectator end def run_before_all - @before_all.each(&.call) + @before_all.each &.call end def run_before_each - @before_each.each(&.call) + @before_each.each &.call end def run_after_all - @after_all.each(&.call) + @after_all.each &.call end def run_after_each - @after_each.each(&.call) + @after_each.each &.call end def wrap_around_each(&block : ->) diff --git a/src/spectator/test_results.cr b/src/spectator/test_results.cr index aa37b9f..bf7f1ef 100644 --- a/src/spectator/test_results.cr +++ b/src/spectator/test_results.cr @@ -37,7 +37,7 @@ module Spectator end def example_runtime - @results.map { |result| result.elapsed }.sum + @results.map(&.elapsed).sum end def overhead_time