test-server

Tests the RDoc live-reload server endpoints, file watching, and page rendering via curl and Playwright.

930|464|Updated Dec 23, 2010
One-click install
npx skills add https://github.com/ruby/rdoc --skill test-server
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-server
Source: https://github.com/ruby/rdoc/tree/main/.claude/skills/test-server
Command: npx skills add https://github.com/ruby/rdoc --skill test-server

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright.

What problem does it solve?

Verifying that the RDoc live-reload server (rdoc --server) works correctly after modifying server code, templates, generators, or routing requires repetitive manual checks of endpoints, caching behavior, and rendered pages.

Core Features & Use Cases

  • Endpoint Verification: Runs curl checks against the root page, /__status JSON endpoint, class pages, CSS/JS assets, 404 handling, and path traversal protection.
  • Live-Reload Validation: Confirms HTML pages embed the polling script and that touching a source file advances the last_change timestamp through the file watcher.
  • Visual Testing: Uses Playwright CLI to capture screenshots of index and class pages for layout and styling review.
  • Use Case: After editing RDoc's server routing or generator templates, run this workflow to confirm all endpoints return correct status codes and the live-reload mechanism detects source changes.

Quick Start

Start the RDoc server with bundle exec rdoc --server and run the endpoint and live-reload verification checks against localhost port 4000.

Frequently Asked Questions about test-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test the RDoc live-reload server?▼

Start the server with bundle exec rdoc --server, then curl the root page, /__status endpoint, class pages, and static assets to verify 200 responses. Touch a source file and confirm the last_change timestamp advances.

How to run rdoc server on a custom port?▼

Pass the port directly to the server flag, for example bundle exec rdoc --server=8080. The default port is 4000 when no port is specified.

Does the RDoc server detect source file changes automatically?▼

Yes, the server runs a file watcher that polls every second and updates the last_change timestamp exposed at /__status. HTML pages poll this endpoint and reload when the value increases.

Why does the RDoc server return 404 for asset paths with dot segments?▼

The server blocks path traversal attempts using an expand_path check, so requests like /css/../../etc/passwd return 404. This prevents serving files outside the documentation tree.

Can I take screenshots of RDoc documentation pages?▼

Yes, use Playwright CLI with npx playwright screenshot followed by the page URL and output path. Run npx playwright install chromium once first to install the browser.