Autoloading without Rails? #2762
-
When installing rspec-rails, adding the gem and running My question is then, does anyone use this? How are you dealing with requiring files? Usually in a Rails application you don't need to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
If you run the whole suite you will end up requiring rails_helper and everything is "as normal", if you run an individual spec file which just requires spec_helper and you haven't setup Ruby's own autoload, typically I'd recommend you require just the files you need in the spec |
Beta Was this translation helpful? Give feedback.
Thats why I said you need to not use split helpers for Zeitwerk, and the same holds true for most gems that integrate tightly with Rails.
Splitting the spec helpers is for people who are comfortable without e.g. zeitwerk, if you are working with "PORO" (plain old ruby object) codebases within Rails apps it offers an easy way to run plain rspec tests without Rails.