Skip to content

test: restructure specs by public method - #691

Merged
route merged 3 commits into
mainfrom
test/spec-structure
Nov 1, 2026
Merged

route merged 3 commits into
mainfrom
test/spec-structure

Conversation

@route

@route route commented Nov 1, 2026

Copy link
Copy Markdown
Member

Standardizes the spec suite and records the rules in AGENTS.md.

  • Every spec file mirrors the lib/ path of the class in its top describe, feature and unit specs alike. spec/unit/process* move under spec/unit/browser/.
  • Each nested describe names one public method ("#method" / ".method"). Topic describes and examples directly under the class are regrouped by the method they exercise; specs of methods defined elsewhere move to that class's file (new spec/frame/dom_spec.rb, spec/page/frames_spec.rb, spec/target_spec.rb, spec/accessibility/ax_node_spec.rb).
  • Contexts only for contrasting groups, or a single one that carries shared let/hooks/tags; no nested contexts. Example names start with a third-person verb.
  • No specs of private methods: Browser#debug_url is covered through #debug, Process#parse_ws_url through #start.
  • No shared examples or example-generating loops, so every example runs alone with rspec file:line; shared steps live in helper methods. The data tables in spec/unit/frame/script_spec.rb are the one exception.
  • Fixes #resize fullscreen specs, where two include_examples overrode each other's let(:path) and the /custom_html_size case never ran.

Example names change throughout; no example was dropped except two identical copies of "resets element positions after" in the screenshot spec.

route added 3 commits November 1, 2026 15:27
Group every spec under `describe "#method"` of the class it describes, move specs of methods defined elsewhere to
the matching file (Frame::DOM, Page::Frames, Target, AXNode), drop specs of private methods in favor of their public
callers, and replace shared examples with helper methods so each example runs alone with `rspec file:line`.
@route
route merged commit c0c508b into main Nov 1, 2026
7 checks passed
@route
route deleted the test/spec-structure branch November 1, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant