Skip to content

Add response including Add f_http_client_response_including RSpec matcher with Ruby 3.2-4.0 support#21

Merged
bvicenzo merged 6 commits into
masterfrom
bv-add-response-including-matcher
Feb 4, 2026
Merged

Add response including Add f_http_client_response_including RSpec matcher with Ruby 3.2-4.0 support#21
bvicenzo merged 6 commits into
masterfrom
bv-add-response-including-matcher

Conversation

@bvicenzo
Copy link
Copy Markdown
Collaborator

@bvicenzo bvicenzo commented Feb 2, 2026

Tipo de alteração

  • Nova feature.
  • ✔️ Dívida técnica.

Detalhes da solução

Nova Feature: Matcher f_http_client_response_including

Adiciona um novo matcher RSpec que permite testar objetos HTTParty::Response de forma mais expressiva e clara.

Funcionalidades:

  • Suporta matchers RSpec aninhados (have_attributes, a_hash_including, etc.)
  • Funciona com os matchers .and_value() e .and_error() do FService
  • Fornece mensagens de falha claras e descritivas

Exemplo de uso:

expect(response).to f_http_client_response_including(
  code: 200,
  body: a_hash_including('users' => array_including(a_hash_including('name' => 'John')))
)

Atualização do CI

Atualiza o workflow de CI para rodar com Ruby 3.2, 3.3 e 4.0 nas versões mais recentes, garantindo compatibilidade com as versões modernas do Ruby.

Compatibilidade com Ruby 4.0+

  • Atualiza activesupport para >= 7.2
  • Adiciona gems necessárias: ostruct, csv, benchmark, racc
  • Atualiza configuração do RuboCop (plugins, renomeia PredicateName → PredicatePrefix)

Contexto Adicional

A implementação deste matcher facilita a escrita de testes para respostas HTTP, especialmente quando combinado com o FService.

TO-DO

N/A

Checklist

  • Testes para novos comportamentos inseridos.
  • Atualização do Changelog.
  • Nova versão.

- Add new matcher to test HTTParty::Response objects
- Supports nested RSpec matchers (have_attributes, a_hash_including, etc.)
- Works with FService's .and_value() and .and_error() matchers
- Provides clear failure messages
- Fix Ruby 4.0+ compatibility:
  - Update activesupport to >= 7.2
  - Add ostruct, csv, benchmark, racc gems
  - Update RuboCop config (plugins, rename PredicateName → PredicatePrefix)
- Update documentation with usage examples
- Add rubocop-vicenzo plugin
- Configure layout cops for consistent argument and method call formatting
- Apply new formatting rules to codebase
@bvicenzo bvicenzo self-assigned this Feb 2, 2026
@bvicenzo bvicenzo added the enhancement New feature or request label Feb 2, 2026
@bvicenzo bvicenzo changed the title Bv add response including Add f_http_client_response_including RSpec matcher with Ruby 3.2-4.0 support Add response including Add f_http_client_response_including RSpec matcher with Ruby 3.2-4.0 support Feb 2, 2026
@bvicenzo bvicenzo merged commit 601045d into master Feb 4, 2026
3 checks passed
@bvicenzo bvicenzo deleted the bv-add-response-including-matcher branch February 4, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant