Omochi
Omochi is a CLI tool to support Ruby on Rails development with RSpec. It detects methods uncovered by tests and prints the test code generated by LLM.
There are two advantages of using Omochi. We can make sure every method is covered by tests with GitHub Actions support. We can also generate spec files for uncovered methods so that we can reduce time to write them manually.
Installation
$ gem specific_install -l https://github.com/mikik0/omochi.git
Usage
$ omochi --help
Commands:
omochi help [COMMAND] # Describe available commands or one specific command
omochi verify local_path # verify spec created for all of new methods and functions
Commands
verify
When you execute Omochi locally, you can confirm that you have spec coverage for uncommitted diff.
# Local
$ omochi verify local_path
You can skip check with ignore comment.
#omochi:ignore:
--create option
You can generate spec files with LLM by giving -c
or --create
option. It outputs to STDOUT.
# Generate spec files
$ omochi verify local_path -c
# Or
$ omochi verify local_path --create
--github option
With -h
option you can check uncovered methods against given Pull Request with GitHub Actions.
It uses gh pr diff
command internally.
$ omochi verify local_path -h
# Or
$ omochi verify local_path --github
Samples
$ omochi verify -c
"Verify File List: [\"lib/omochi/cli.rb\", \"lib/omochi/util.rb\"]"
"specファイルあり"
"There are spec files."
===================================================================
verify
Contributing
Bug reports and Pull Requests are accepted on GitHub (https://github.com/mikik0/omochi). This project should be a safe place for collaboration.
Design
See DESIGN.md
Development
Requirement
- ruby3.x
- AWS Credentials (for
--create
)
git clone https://github.com/mikik0/omochi.git
bundle install
bundle exec bin/omochi verify