Welcome to the RSpec File Generator extension for Visual Studio Code! This tool is designed to boost the efficiency of Ruby on Rails developers by automating the creation of RSpec test files directly from the VS Code interface with just a right-click.
VS Code Extension Marketplace link
This extension provides a seamless experience for generating RSpec test files:
- Context Menu Integration: Right-click any Ruby file and select "Generate RSpec File" to create a corresponding test file in the
specdirectory with the_spec.rbsuffix. - Automatic Directory Management: Automatically creates any necessary directories in the
specpath to maintain the standard Rails directory structure. - Notification Feedback: Receive immediate notification feedback on successful file creation or if the file already exists.
For example, here's how you can use the extension in action:
This extension requires:
- Visual Studio Code 1.50.0 or higher
- Ruby on Rails environment set up in the workspace
This extension contributes the following settings:
rspecFileGenerator.enable: Enable/disable this feature.rspecFileGenerator.createSpecDirectory: Automatically create spec directory if it does not exist.
Currently, there are no known issues. Should any arise, they will be listed here to help avoid duplicate issue reporting.
- Fix recursively directory creation
- Keep "Controller" in the describe block name
- Removed automatically generated type: (:model, :request, :job)
- Removed unnecessary comma after the class name
- Added a new line at the end of the spec file
- Initial release of RSpec File Generator.
- Full functionality for generating RSpec files with context menu integration.
- Fixed minor bugs related to file path resolutions.
- Added support for custom configurations via extension settings.
Ensure you've read through the extension guidelines and adhere to best practices for creating your extension.
Markdown is supported natively in Visual Studio Code. Useful shortcuts:
- Split the editor (
Cmd+\on macOS orCtrl+\on Windows and Linux). - Toggle preview (
Shift+Cmd+Von macOS orShift+Ctrl+Von Windows and Linux). - Press
Ctrl+Space(Windows, Linux, macOS) to see a list of Markdown snippets.
Enjoy your streamlined Rails testing workflow with the RSpec File Generator!
