Keploy as a Ruby testing framework
Keploy tests Ruby applications by recording real HTTP and ActiveRecord traffic from a running app, then replaying it as assertions. There are no WebMock stubs to register, no VCR cassettes to re-record by hand, and no test database to load a schema into.
keploy record -c "bundle exec rails server"What Keploy gives a Ruby team
Any Ruby app, unchanged
Keploy runs the app through rails server, rackup, or Puma. Rails, Sinatra, Hanami, and plain Rack apps all record the same way because capture happens at the socket.
- Ruby 3.0 and above
- Rails, Sinatra, Hanami, Rack
- Puma, Unicorn, or Passenger
- No spec_helper changes
Why Ruby integration tests slow teams down
The friction is rarely the assertions. It is everything around them — spinning up dependencies, keeping mocks honest, and repairing tests after every refactor.
Testing Ruby: by hand, with RSpec + WebMock, or with Keploy
WebMock stubs and VCR cassettes are both frozen the moment they are written. Keploy records the real exchange, so re-recording refreshes every mock at once instead of one cassette at a time.
Select any row for the full comparison, with code.
What you write for Ruby vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
Two double classes exist only for this file, and both hard-code a shape nothing verifies against the real Postgres rows or Stripe response.
Readable and fully offline — and the Stripe body is a hand-typed literal that no longer resembles the real response the day their API changes.
The mock is the SQL ActiveRecord actually generated, so a scope change shows up as a real diff instead of passing against a factory-built record.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
Ruby testing tools, compared
The options a team on Ruby actually reaches for, and where each one genuinely wins. Select a row for the full comparison.
Assessments reflect each tool’s documented behaviour, not benchmark measurements.
Record your Ruby app once, replay it forever
Keploy sits below your Ruby process at the network layer. It watches the calls your app already makes, then serves them back on replay so tests run with no dependencies attached.
Keploy records a GET call to /api/v1/orders/{id} on a Ruby service and captures the dependency calls it makes.
What Keploy mocks for Ruby, with zero config
6 of the 7 dependencies a typical Ruby service talks to are stubbed from the recording itself — no mock classes, no fixture files, no containers in CI.
- Auto-mocked
PostgreSQLView page
Postgres protocol under the pg adapter
- Auto-mocked
MySQLView page
MySQL protocol under mysql2
- Auto-mocked
RedisView page
RESP under redis-rb
- Auto-mocked
MongoDBView page
Wire protocol under Mongoid and the Ruby driver
- Outbound HTTPAuto-mocked
Outbound HTTP
Any Net::HTTP, Faraday, or HTTParty call
- Auto-mocked
SidekiqView page
Job pushes as the Redis commands they really are
- Partial
Apache KafkaView page
Kafka protocol under ruby-kafka
Your first Ruby test suite in under five minutes
Every command below runs against your existing Ruby service. Nothing in your source tree changes.
1Install the Keploy CLI
A single binary. It needs a Linux kernel with eBPF support, or Docker on macOS and Windows — and it adds nothing to your project's dependencies.
curl -sSL https://keploy.io/install.sh | bash2Record your service
Pass the command you already use to start the app. Keploy runs it and watches every socket it opens.
keploy record -c "bundle exec rails server"3Exercise the paths you care about
Drive the app with curl or your frontend. Every request becomes a test case with its ActiveRecord queries and HTTP calls captured alongside.
curl -X POST localhost:3000/orders/ord_1/confirm -H 'Content-Type: application/json' -d '{"payment_token":"tok_123"}'4Replay in CI
Replay serves the recorded dependency responses, so the job needs no service containers and no Docker daemon.
keploy test -c "bundle exec rails server" --delay 12
Ready to try it on your own Ruby service?
Works with the rest of your Ruby stack
Keploy records at the network layer, so framework and driver choices inside your Ruby app do not change how it captures traffic.
Ruby on Rails
Recorded through rails server — the full middleware stack runs.
Sinatra
Same capture path; a Rack app records identically.
ActiveRecord
Queries record as the SQL they generate, with real rows.
Sidekiq
Job pushes appear as the Redis exchanges they really are.
PostgreSQL
The database page covers protocol-level capture in depth.
Bundler
Nothing to add — Keploy is a CLI, not a gem.
Testing the rest of your stack
- Frameworks
Keploy as a Ruby on Rails testing framework
Test Rails requests against recorded ActiveRecord queries and real HTTP responses, with no schema load and no VCR cassettes.
Read the guide - Databases
Keploy as a PostgreSQL testing framework
Record the Postgres frontend/backend protocol once and replay real result sets in tests — no container, no pg-mem, no schema to rebuild.
Read the guide - Databases
Keploy as a MySQL testing framework
Mock MySQL at the wire protocol instead of standing up a container or swapping in H2 — the rows your queries really returned, replayed.
Read the guide - Caches & Stores
Keploy as a Redis testing framework
Record RESP traffic once and replay real cache hits, misses, TTLs, and pipeline responses without a Redis server in CI.
Read the guide - Databases
Keploy as a MongoDB testing framework
Mock MongoDB at the wire protocol — real documents, real BSON types, real aggregation results — without a mongod binary in CI.
Read the guide - Message Queues
Keploy as a Apache Kafka testing framework
Test producers and consumers against recorded broker exchanges — no embedded Kafka, no Testcontainers cluster, no flaky poll loops.
Read the guide
Join our GlobalCommunity
Connect with developers worldwide. Follow updates, ask questions, share feedback, and ship faster with other Keploy builders.
“Best report of integration and API tests I've seen — which we don't get from RestAssured.”
G2“Future of microservices testing. I don't write tests now!”
G2 · 5/5“An amazing product that simplifies the automation.”
Gartner · 4.0