git404hub

what is insta-ruby fr?

marcoroth/insta-ruby — explained in plain English

Analysis updated 2026-05-18

51RubyAudience · developerComplexity · 2/5Setup · easy

tl;dr

A Ruby snapshot testing library for Minitest and RSpec that captures full test output and shows an interactive diff whenever it changes.

vibe map

mindmap
  root((repo))
    What it does
      Captures snapshot test output
      Shows interactive diffs
      Supports inline snapshots
    Tech stack
      Ruby
      Minitest
      RSpec
    Use cases
      Test large JSON API responses
      Test rendered HTML output
      Redact volatile IDs and timestamps
    Audience
      Ruby developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Assert an entire JSON API response or rendered HTML page without writing field-by-field checks.

VIBE 2

Catch unintended changes in CLI output or compiled AST structures during refactors.

VIBE 3

Redact volatile values like IDs and timestamps so snapshots stay stable across runs.

VIBE 4

Bootstrap and update inline snapshot expectations directly inside test source files.

what's the stack?

RubyMinitestRSpec

how it stacks up fr

marcoroth/insta-rubyakitaonrails/github-visualizeruby-concurrency/ref
Stars515564
LanguageRubyRubyRuby
Last pushed2020-11-17
MaintenanceDormant
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 30min

Add the insta gem, write an assertion, then run the interactive insta review command to accept the first snapshot.

The README does not state the license terms directly, so check the project's LICENSE file before relying on specific reuse permissions.

in plain english

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.

prompts (copy fr)

prompt 1
Show me how to add insta-ruby to my Gemfile and write my first Minitest snapshot test.
prompt 2
Help me set up redaction selectors so my snapshot ignores a timestamp field.
prompt 3
Explain the difference between assert_snapshot and assert_inline_snapshot in insta-ruby.
prompt 4
Walk me through configuring insta-ruby with a shared .insta.rb file for my project.

Frequently asked questions

what is insta-ruby fr?

A Ruby snapshot testing library for Minitest and RSpec that captures full test output and shows an interactive diff whenever it changes.

What language is insta-ruby written in?

Mainly Ruby. The stack also includes Ruby, Minitest, RSpec.

What license does insta-ruby use?

The README does not state the license terms directly, so check the project's LICENSE file before relying on specific reuse permissions.

How hard is insta-ruby to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is insta-ruby for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.