Assert an entire JSON API response or rendered HTML page without writing field-by-field checks.
Catch unintended changes in CLI output or compiled AST structures during refactors.
Redact volatile values like IDs and timestamps so snapshots stay stable across runs.
Bootstrap and update inline snapshot expectations directly inside test source files.
| marcoroth/insta-ruby | akitaonrails/github-visualize | ruby-concurrency/ref | |
|---|---|---|---|
| Stars | 51 | 55 | 64 |
| Language | Ruby | Ruby | Ruby |
| Last pushed | — | — | 2020-11-17 |
| Maintenance | — | — | Dormant |
| Setup difficulty | easy | moderate | easy |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Add the insta gem, write an assertion, then run the interactive insta review command to accept the first snapshot.
insta-ruby is a snapshot testing library for Ruby test suites, working with both Minitest and RSpec. Instead of writing a separate assertion for every detail of an expected result, you assert the whole output at once and let Insta manage the reference value for you. The first time a test runs, Insta saves what it captured as a pending snapshot, and you review it, in a terminal, to accept or reject it as correct. Once accepted, future test runs compare fresh output against that saved snapshot and fail with a diff, powered by difftastic, whenever something changes, so you can see exactly what changed before deciding whether it is expected. This style of testing is well suited to values that are large, tedious to write assertions for by hand, or that change often, such as a full JSON API response, rendered HTML, a compiled output structure, CLI output, or error messages. The README is careful to note that Insta is not a replacement for HTTP mocking tools like WebMock or VCR, since those control what goes into your code while Insta checks what comes out, and the two approaches work naturally together. Snapshots are not limited to plain strings. You can capture structured Ruby values using a serializer such as JSON or YAML, and give each snapshot in a test a name so multiple snapshots can live inside one test method. Volatile values that would otherwise change on every run, like database IDs or timestamps, can be redacted using selectors similar to jq, replacing them with a fixed placeholder in the saved snapshot. Insta also supports inline snapshots, where the expected value is written directly into the test file itself rather than a separate file, and Insta will automatically insert or update that value in your source code once you review and accept a change. The library is configurable, letting you set things like the snapshot storage path, how diffs are displayed, and default serializers, either in your test setup or in a shared .insta.rb config file so both your test run and the separate review command use the same settings. It installs as a Ruby gem and ships with its own insta command line tool for reviewing and managing pending snapshots. The project was extracted from another project called Herb and takes inspiration from the insta crate in Rust and Vitest's snapshot feature in JavaScript.
A Ruby snapshot testing library for Minitest and RSpec that captures full test output and shows an interactive diff whenever it changes.
Mainly Ruby. The stack also includes Ruby, Minitest, RSpec.
The README does not state the license terms directly, so check the project's LICENSE file before relying on specific reuse permissions.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.