fakefs/fakefs
A fake filesystem. Use it in your tests. observed · 2026-08-28
Health v2 · maintenance only
56/100
- Activity 74
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 6305
- days_rel: n/a
- days_push: 156
- n_releases_24m: 0
Adoption not part of the score
1061 stars · 191 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
FakeFS is a Ruby gem that provides an in-memory fake filesystem, monkey-patching File, FileUtils, Dir, and related classes so tests can exercise filesystem code without touching the real disk. It can be activated temporarily via a block or helper modules for RSpec.
Use cases
- test ruby code that writes files without touching the real disk
- mock filesystem operations in rspec tests
- avoid mocking FileUtils calls directly in unit tests
- create isolated temporary filesystems for each test
- test code that uses absolute paths safely
When to choose
- you are writing Ruby tests for code that reads or writes the filesystem
- you want behavior-based tests instead of brittle method mocks on File or FileUtils
- you need a fresh, isolated filesystem per test example
When to avoid
- your code relies on IO methods beyond basic file operations, which are not mocked by default
- you can simply use real temp directories (Dir.mktmpdir) for your tests
- your project uses gems that monkey-patch File and may conflict with FakeFS
Facets
library · maturity active
testing mocking file-system testing developer-tools files ruby cross-platform fake-filesystem ruby-gem rspec test-isolation
1 source
- readme: https://github.com/fakefs/fakefs · fetched 2026-08-28 · b6843742b756
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| fakefs/fakefs | main | 56 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem