Skip to content

Commit

Permalink
Wrap reloadable constant calls in to_prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Oct 15, 2023
1 parent b71e7d0 commit ecfe44d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/rspec-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ module Rails
# Railtie to hook into Rails.
class Railtie < ::Rails::Railtie
# As of Rails 5.1.0 you can register directories to work with `rake notes`
require 'rails/source_annotation_extractor'
::Rails::SourceAnnotationExtractor::Annotation.register_directories("spec")
config.to_prepare do
require 'rails/source_annotation_extractor'
::Rails::SourceAnnotationExtractor::Annotation.register_directories("spec")
end
generators = config.app_generators
generators.integration_tool :rspec
generators.test_framework :rspec

generators do
::Rails::Generators.hidden_namespaces.reject! { |namespace| namespace.to_s.start_with?("rspec") }
config.to_prepare do
::Rails::Generators.hidden_namespaces.reject! { |namespace| namespace.to_s.start_with?("rspec") }
end
end

rake_tasks do
Expand Down

0 comments on commit ecfe44d

Please sign in to comment.