• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lostisland / faraday / #4712
96%
master: 92%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 25 Nov 2026 09:09AM UTC
Jobs 1
Files 35
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Nov 2026 09:08AM UTC coverage: 95.998% (+0.3%) from 95.69%
#4712

push

web-flow
Convert Env to BaseOptions (#1653) (#1740)

* Convert Env to BaseOptions (#1653)

Env was the last Options class built on Struct. Middleware reads and
writes it on every request. The conversion keeps the API that the
gems in awesome-faraday use:
- [] and []= with custom members and the body key
- delete, dig, to_hash, dup, and update with a body key
- the streaming helpers and the Env constants

The rest of the Struct API (each, members, ==, fetch, key?,
positional new) goes, as for the other converted classes. No
Faraday 2 gem calls it.

Env keeps the old semantics where BaseOptions differs:
- to_hash keeps RequestOptions and SSLOptions as objects.
- Env.from(env) copies the options, headers and Hash values, but
  shares bodies and the URL, so a large parsed body is not copied.
- The writers and []= do not coerce.

false means "not set" for request, ssl and the headers, like in
ConnectionOptions. ssl is now coerced to SSLOptions. Before, a Hash
stayed a Hash.

Env.for_request replaces the positional Env.new calls in core. It
assigns the request options and headers without copying them, so a
request costs no extra allocations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the legacy merge and copy semantics of Env

The inspect spec failed on Ruby 3.0 to 3.3, which print a Hash as
{:custom=>1}. The spec now builds the expected text with Hash#inspect.

The review of #1740 found two changes from the Struct that middleware
could notice. merge! deep-merged every Hash member, so merging params
or a Hash body combined them instead of replacing them. update and
from stored the caller's Hash instead of a copy. Env now deep-merges
only the coerced members and copies other Hash values on write, as
the Struct did.

The docs now say which methods accept the String 'body' key, and that
Env#to_hash keeps nested options objects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

89 of 89 new or added lines in 3 files covered. (100.0%)

14 existing lines in 10 files now uncovered.

1679 of 1749 relevant lines covered (96.0%)

147.37 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
91.47
-1.55% lib/faraday/adapter/test.rb
2
97.7
-2.3% lib/faraday/error.rb
2
93.33
-3.33% lib/faraday/logging/formatter.rb
1
98.0
-2.0% lib/faraday/base_options.rb
1
84.66
-0.61% lib/faraday/connection.rb
1
95.83
-4.17% lib/faraday/middleware_registry.rb
1
96.3
-3.7% lib/faraday/options/proxy_options.rb
1
97.06
-2.94% lib/faraday/request/json.rb
1
95.65
-4.35% lib/faraday/response/raise_error.rb
1
95.77
-1.45% lib/faraday/utils.rb
Jobs
ID Job ID Ran Files Coverage
1 #4712.1 25 Nov 2026 09:09AM UTC 35
96.0
Source Files on build #4712
  • Tree
  • List 35
  • Changed 21
  • Source Changed 0
  • Coverage Changed 21
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 81739626 on github
  • Prev Build on main
  • Next Build on main
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc