# MissingRspec This Gem extracts RSpec files that have not yet been created. ## Installation To use it, add it to your Gemfile: ```ruby gem 'missing_rspec', group: :development ``` ## How to use the preview ### How to specify rails path as an argument to rake Example when rails path is /app ```shell bin/rails missing_rspec[/app] ``` ### How to specify the rails path in the environment variable ```shell bin/rails runner "puts Rails.root.to_s" ``` Set environment variables using methods such as dot_env Example .env file when rails path is /app ```shell RAILS_APP_PATH=/app ``` ```shell bin/rails missing_rspec ``` ### The second argument can be used to narrow down the target. The following is an example of specifying models, controllers and jobs. ```shell bin/rails missing_rspec[/app,models\;controllers\;jobs] ``` ### Execution example ```shell bin/rails missing_rspec The following folders are targeted: ["channels", "controllers", "forms", "helpers", "jobs", "lib", "mailers", "models", "presenters", "services"] ├channel.rb └connection.rb │ ├allowed_sources_controller.rb │ ├base.rb │ ├sessions_controller.rb │ ├staff_events_controller.rb │ ├staff_members_controller.rb │ └top_controller.rb ├ │ └error_handlers.rb ├ │ ├accounts_controller.rb │ ├base.rb │ ├entries_controller.rb │ ├messages_controller.rb │ ├programs_controller.rb │ ├replies_controller.rb │ ├sessions_controller.rb │ └top_controller.rb ├ │ ├accounts_controller.rb │ ├base.rb │ ├customers_controller.rb │ ├entries_controller.rb │ ├messages_controller.rb │ ├passwords_controller.rb │ ├programs_controller.rb │ ├replies_controller.rb │ ├sessions_controller.rb │ └top_controller.rb ├application_controller.rb └errors_controller.rb │ └login_form.rb ├ │ ├account_form.rb │ └login_form.rb └ ├change_password_form.rb ├customer_form.rb ├customer_search_form.rb ├entries_form.rb └login_form.rb ├application_helper.rb └staff_helper.rb └application_job.rb ├html_builder.rb └simple_tree.rb └application_mailer.rb │ ├email_holder.rb │ ├password_holder.rb │ ├personal_name_holder.rb │ └string_normalizer.rb ├address.rb ├application_record.rb ├customer.rb ├customer_message.rb ├entry.rb ├hash_lock.rb ├home_address.rb ├message.rb ├message_tag_link.rb ├phone.rb ├program.rb ├staff_event.rb ├staff_member.rb ├staff_message.rb ├tag.rb └work_address.rb ├address_form_presenter.rb ├address_presenter.rb ├allowed_source_presenter.rb ├confirming_address_form_presenter.rb ├confirming_customer_form_presenter.rb ├confirming_form_presenter.rb ├confirming_user_form_presenter.rb ├customer_form_presenter.rb ├customer_presenter.rb ├form_presenter.rb ├message_presenter.rb ├model_presenter.rb ├program_form_presenter.rb ├program_presenter.rb ├staff_event_presenter.rb ├staff_member_form_presenter.rb ├staff_member_presenter.rb └user_form_presenter.rb │ ├allowed_sources_deleter.rb ├ │ ├authenticator.rb │ └entry_acceptor.rb └ ``` ## How to use the creator Note: Due to the large number of rspec files to be written, It is recommended that you git-commit the file before executing it so that you can revert it. ### Create all RSpecs shown in preview. Example when rails path is /app ```shell bin/rails missing_rspec_create[/app] ``` Example .env file when rails path is /app ```shell RAILS_APP_PATH=/app ``` ```shell bin/rails missing_rspec_create ``` ### The second argument can be used to narrow down the target. The following is an example of specifying models, controllers and jobs. ```shell bin/rails missing_rspec_create[/app,models\;controllers\;jobs] ``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/kayamak/missing_rspec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/kayamak/missing_rspec). ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). ## Code of Conduct Everyone interacting in the MissingRspec project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kayamak/missing_rspec).