샘플
Test Faraday code against stubbed HTTP with no network, and work out which parts of Faraday 2 still need an extra gem
sha256:46eed9d91592cb5df8548ed6884a818eba294fbab879f42106d919a145b91d8a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Test Faraday code against stubbed HTTP with no network, and work out which parts of Faraday 2 still need an extra gem HOW
- 패키지
- faraday 2.11.0 faraday-net_http 3.3.0
- 환경
- ruby 3
- 생성일
- 2026-08-14T09:45:11Z
컨트랙트
- assert a Faraday::Adapter::Test stub matching path and query serves the whole connection with no socket
- assert a query the stub declared has to match exactly, while a parameter it did not name is ignored and a stub with no query matches every query
- assert an unmatched request raises Faraday::Adapter::Test::Stubs::NotFound naming the URL
- assert the host from the connection url_prefix reaches the matcher, so a stub written for another host does not match
- assert a 500 without raise_error is only a response, and with raise_error is a Faraday::ServerError
- assert middleware order decides whether the raised error carries a parsed or a raw body
- assert raise_error maps a 404 to Faraday::ResourceNotFound
- assert a JSON body stays a String until the json middleware is added, and then only on a JSON content type
- assert verify_stubbed_calls raises on a stub that went unused, while a consumed stub still answers a repeat call
- assert the test adapter and the json and raise_error middleware ship inside faraday itself
- assert the default net_http adapter is a separate gem, an unregistered adapter fails at lookup, and the default adapter really opens a socket
- assert no json gem is resolved into the bundle, because faraday 2.11 parses with the json Ruby ships
파일
- Gemfile
- Gemfile.lock
- csx.json
- src/api.rb
- test/contract.rb
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · gem@1 · 2026-08-14 · ed25519:a2ec939a4c60e243
- · CONTAINER_RUN · compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL · gem@1 · 2026-08-14 · ed25519:7da3f610facce8bf