rspec / rspec-rails

RSpec for Rails 6+
https://rspec.info
MIT License
5.14k stars 1.03k forks source link

Remove type metadata from templates #2730

Closed r7kamura closed 4 months ago

r7kamura commented 4 months ago

rspec-rails will generate spec/rails_helper.rb with config.infer_spec_type_from_file_location! enabled. So by default it assumes a project that does not explicitly specify type metadata.

https://github.com/rspec/rspec-rails/blob/06d05aba209565f5bc940aa9e67232c8616e5197/lib/generators/rspec/install/templates/spec/ rails_helper.rb#L78

Therefore, shouldn't the generators also generate a test file skeleton that does not explicitly specify type metadata?

pirj commented 4 months ago

https://github.com/rspec/rspec-rails/issues/2507#issuecomment-1107794265 we are more incluned to keep explicit types, and remove inferred.