Skip to content

test: restructure specs by public method - #357

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

route merged 2 commits into
mainfrom
test/spec-structure

Conversation

@route

@route route commented Nov 1, 2026

Copy link
Copy Markdown
Member

Standardizes the spec suite the same way as rubycdp/ferrum#691 and records the rules in a new AGENTS.md.

  • Spec files mirror lib/capybara/cuprite: spec/driver_spec.rb, spec/node_spec.rb, spec/browser_spec.rb, spec/browser/extensions_spec.rb, spec/node/extensions_spec.rb. Unit specs move from spec/lib/ to spec/unit/, and the Capybara shared suite moves to spec/capybara_spec.rb.
  • spec/features/session_spec.rb is gone: its examples move to the class whose public method they exercise (mostly Node, the rest Driver, Browser::Extensions and Node::Extensions).
  • Each nested describe names one public method. Contexts are used only for contrasting groups or when they carry shared let/hooks/tags; no nested contexts. Example names start with a third-person verb.
  • No specs of private methods: the threadsafe check on session_wait_time is now covered through evaluate_async_script.
  • The HTML5 drag offsets no longer come from a loop, so every example runs alone with rspec file:line.

The example count is unchanged (1808).

route added 2 commits November 1, 2026 18:28
Mirror lib/capybara/cuprite in spec/: Driver, Node, Browser and their Extensions get one file each, grouped under
`describe "#method"`, and spec/lib moves to spec/unit. Examples from session_spec.rb move to the class they exercise.
The private session_wait_time is covered through evaluate_async_script, and the HTML5 drag offsets no longer come
from a loop, so every example runs alone with `rspec file:line`.
@route
route merged commit baff7af into main Nov 1, 2026
6 checks passed
@route
route deleted the test/spec-structure branch November 1, 2026 16:19
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