You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With RSpec as the project-wide default test framework, rails generate generator always errors out.
$ bin/rails g generator foobar
Running via Spring preloader in process 45230
create lib/generators/foobar
create lib/generators/foobar/foobar_generator.rb
create lib/generators/foobar/USAGE
create lib/generators/foobar/templates
error rspec [not found]
I think this is because there is not a generator spec generator, so the rails generator generator is looking for something that isn't there.
Expected behaviour
A spec/lib/generators/foobar_generator_spec.rb file is generated with the helpers from spec/support/generators (run_generator and friends) available (I guess that would need to be required in spec_helper by default as well).
Digging around I discovered that this project is using ammeter which has solved my immediate problem. However, it would still be nice if RSpec would generate a spec file on rails g generator foo ... I leave it to you folks to decide whether it's worth the time to implement.
(Sorry for the crazy Dr Seuss issue name - and sorry if this has been reported before, it's very difficult to search for ... )
What Ruby, Rails and RSpec versions are you using?
Ruby version: 2.5.3p105
Rails version: 5.2.2
Rspec version: 3.8
Observed behaviour
With RSpec as the project-wide default test framework,
rails generate generator
always errors out.I think this is because there is not a generator spec generator, so the rails generator generator is looking for something that isn't there.
Expected behaviour
A
spec/lib/generators/foobar_generator_spec.rb
file is generated with the helpers fromspec/support/generators
(run_generator
and friends) available (I guess that would need to be required inspec_helper
by default as well).Can you provide an example app?
https://github.com/tragiclifestories/rspec-generator-issue
The text was updated successfully, but these errors were encountered: