rspec / rspec-rails

RSpec for Rails 7+
https://rspec.info
MIT License
5.19k stars 1.04k forks source link

Comment out `infer_spec_type_from_file_location!` in generated helper. #2804

Closed JonRowe closed 2 months ago

JonRowe commented 2 months ago

We would prefer that people tag their specs manually (or via generators) and whilst our generators do generate tags we never removed the generated infer_spec_type_from_file_location! as a default.

Fixes #2803

JonRowe commented 3 weeks ago

Released in 7.1.0

tisba commented 2 weeks ago

Out of curiosity, @JonRowe: What is the reasoning behind the recommendation to tag specs manually over inferring from location?

JonRowe commented 2 weeks ago

A combination of factors, it is better to be explicit about things to improve the "documentation" effect, it makes it less surprising when you include extra helpers into different types of specs and its less brittle as an implementation.

BenMorganMY commented 2 weeks ago

I think this really goes against the naming conventions that Rails instills.

JonRowe commented 2 weeks ago

I think this really goes against the naming conventions that Rails instills.

Rails doesn't automatically configure things based on directories either, you inherit from classes e.g. ActionController::Base