-
Notifications
You must be signed in to change notification settings - Fork 22.2k
Closed
Labels
Description
Steps to reproduce
- Generate a generator:
rails generate generator foo - Edit generator to call
generate('scaffold foos') - Edit generator test to
assert_file('app/controllers/foos_controller.rb') - Observe test failure
Demo: https://github.com/tubbo/rails-app-33558
Expected behavior
The file app/controllers/foos_controller.rb should have appeared in the destination_root
Actual behavior
The following output is observed in tests:
Run options: --seed 1177
# Running:
/Users/tscott/.rbenv/versions/2.4.3/bin/ruby: No such file or directory -- bin/rails (LoadError)
F
Failure:
FooGeneratorTest#test_generator_generates_generated_generators [/Users/tscott/Code/throwaway/test/lib/generators/foo_generator_test.rb:12]:
Expected file "app/controllers/foos_controller.rb" to exist, but does not
bin/rails test test/lib/generators/foo_generator_test.rb:9
Finished in 0.046933s, 21.3070 runs/s, 21.3070 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
System configuration
I've tested this on multiple minor versions of Rails 5 and Ruby 2...
Rails version: 5.2.0, 5.1.4
Ruby version: 2.4.3, 2.5.1
Reactions are currently unavailable