diff --git a/spec/unit/hanami/validator_spec.rb b/spec/unit/hanami/validator_spec.rb index c83265c..5a4f833 100644 --- a/spec/unit/hanami/validator_spec.rb +++ b/spec/unit/hanami/validator_spec.rb @@ -36,11 +36,7 @@ expect(result.errors.to_h).to eq(number: ["must be an integer"]) - errors = [] - result.errors.each do |error| - errors << error.text - end - + errors = result.errors.map(&:text) expect(errors).to match_array(["must be an integer"]) end end