ruby

Installation
SKILL.md

Ruby / Rails Skill

EasyPost Monolith: Mock Adapter Pattern

CRITICAL: Prefer mock adapter pattern over message mocking for microservice interactions.

The EasyPost monolith uses a mock adapter pattern instead of RSpec message mocking (allow(...).to receive(...)) for testing interactions with microservices like rUSERS and rUSPS.

Key Components

  1. Mock Adapter Class: In-memory implementation matching live service interface (e.g., SupportUsersMockAdapter)
  2. RSpec Metadata: Tests opt-in with :mock_users or :mock_usps metadata
  3. Factory Integration: Factories automatically populate mock adapter data
  4. Environment Control: MOCK_USERS=1 (default) for fast tests, MOCK_USERS=0 for integration tests

Benefits

Installs
3
Repository
lanej/dotfiles
GitHub Stars
39
First Seen
May 29, 2026
ruby — lanej/dotfiles