rspec

rspec is a skill for Claude Code from hoblin/claude-ruby-marketplace. It costs 125 tokens per session (2,672 once invoked), scanned A, original, MIT.

A guide to RSpec, a Ruby testing framework used to describe expected program behavior with examples and assertions. It covers test structure, setup helpers, test doubles, and matchers.

In plain words
What is it for?
Use it when writing or fixing RSpec tests, editing Ruby spec files, or using describe blocks, expectations, doubles, and matchers.
Why use it?
It helps developers write readable Ruby tests and diagnose or correct failing specifications.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rspec plugin — 1 skill shipped together

Good fit Use it when writing or fixing RSpec tests, editing Ruby spec files, or using describe blocks, expectations, doubles, and matchers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hoblin/claude-ruby-marketplace/rspec
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hoblin/claude-ruby-marketplace --skill rspec
Clone the repo
git clone --depth 1 https://github.com/hoblin/claude-ruby-marketplace

Made for: Claude Code.

Or install rspec, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rspec

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoblin/claude-ruby-marketplace/rspec.svg)](https://agentmods.dev/skills/hoblin/claude-ruby-marketplace/rspec)
Your own site
<a href="https://agentmods.dev/skills/hoblin/claude-ruby-marketplace/rspec"><img src="https://agentmods.dev/badge/skills/hoblin/claude-ruby-marketplace/rspec.svg" alt="Measured on agentmods" height="20"></a>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,672 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00125 $0.02672
Opus 5 $0.00063 $0.01336
Sonnet 5 $0.00025 $0.00534
Haiku 4.5 $0.00013 $0.00267

Measured 8d ago against content hash 1c70348ca326, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

rspec scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 49 executable files (examples/core/basic_structure.rb, examples/core/configuration.rb, examples/core/hooks.rb, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/rspec/skills/rspec/SKILL.md · 350 lines

How it starts

The opening of the file, as written. The whole thing — 350 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RSpec Testing

This skill provides comprehensive guidance for writing effective RSpec tests in Ruby and Rails applications. Use for writing new specs, fixing failing tests, understanding matchers, using test doubles, and following RSpec best practices.

Quick Reference

Basic Structure

RSpec.describe Order do
  subject(:order) { described_class.new(items) }
  let(:items) { [item1, item2] }
  let(:item1) { double("item", price: 10) }
  let(:item2) { double("item", price: 20) }

  describe "#total" do
    it "sums item prices" do
      expect(order.total).to eq(30)
    end
  end

  context "with discount" do
    let(:order) { described_class.new(items, discount: 5) }

    it "applies discount" do
      expect(order.total).to eq(25)
    end
  end
end

Key Concepts

Concept Purpose
describe / context Group related examples
it / specify Define individual test cases
let Lazy-evaluated, memoized helper
let! Eager-evaluated helper (runs before each example)
subject Primary object under test
before / after Setup and teardown hooks
expect Make assertions

Writing Good Specs

Use Named Subject for Method Tests

describe "#calculate_total" do
  subject(:total) { order.calculate_total }

  it "returns sum of items" do
    expect(total).to eq(100)
  end
end

Context Blocks for Different States

describe "#withdraw" do
  context "with sufficient funds" do
    let(:account) { build(:account, balance: 100) }

    it "reduces balance" do
      expect { account.withdraw(50) }.to change(account, :balance).by(-50)
    end
  end

  context "with insufficient funds" do
    let(:account) { build(:account, balance: 10) }

    it "raises error" do
      expect { account.withdraw(50) }.to raise_error(InsufficientFunds)
    end
  end
end

Common Matchers

Equality

expect(x).to eq(y)          # ==
expect(x).to eql(y)         # eql? (type-sensitive)
expect(x).to be(y)          # equal? (identity)

Read the full file on GitHub · 350 lines

Files

What ships with it

54 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 350 lines · 125 tokens per session scan A 1c70348ca326

Subscribe to this mod's changes

rspec is a skill published in the GitHub repository hoblin/claude-ruby-marketplace (37 stars, last pushed today), licensed MIT. It adds 125 tokens to every session and 2,672 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.