Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>runrspecNew to Visual Studio Code? Get it now.
runrspec

runrspec

AS23

|
2 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

RunRSpec

A lightweight VS Code extension to run RSpec test files directly from the editor.

✨ Features

  • ✅ Run the current spec file if you're already in a *_spec.rb file.
  • 🔄 Automatically find and run the corresponding spec file for any Ruby file in app/.
  • 🚫 If the spec file doesn't exist, it logs a helpful message.
  • 💻 Runs the spec using a VS Code integrated terminal.

▶️ Usage

  1. Open any Ruby file (.rb) or RSpec file (*_spec.rb).

  2. Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).

  3. Run the command:
    Run RSpec for Current File

    It will:

    • Run the file if it's a spec.
    • Otherwise, look for a matching spec in the spec/ directory and run it.
    • Show a message if the matching spec file is not found.

🛠️ Example

  • Editing: app/models/user.rb
    → Will run: spec/models/user_spec.rb (if it exists)

  • Editing: spec/controllers/posts_controller_spec.rb
    → Will run that exact file.

🧠 Assumptions

  • Your project uses the default
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft