Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

quality.testing

Avoid live HTTP clients in Ruby unit tests

Net::HTTP, Faraday, or HTTParty usage in specs should be doubled or recorded.

#Metadata

Rule ID
ruby.testing.real-network-in-unit-test
Severity
medium
Confidence
0.64
Languages
ruby
Presets
recommended, strict
Stability
experimental
Applies to
block
Tags
ruby, rules-catalog, testing

#Why it matters

Live HTTP couples CI to the network.

#Remediation

Use WebMock/VCR or dependency-injected doubles instead of live calls.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/ruby/ruby.testing.real-network-in-unit-test.rule.yaml.