-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test builder #111
test builder #111
Conversation
bfb62ac
to
bd45542
Compare
I commented to ono-san via slack. |
348d192
to
bbf8a54
Compare
I know I'm not the target audience of this feature, but I want to provide some opinions on it. While I appreciate the effort to make writing tests easier, I wonder if its maintenance cost would exceed the benefit it brings. The current test interface is already easy-to-use and copy&paste tests works pretty well, so the benefit is not significant to me. If we breakdown the pros and cons of this feature: Pros
Cons
(Personally, I wouldn't use this feature at all. Copying and paste existing tests feel easier to me. But I should also mention that I'm not a fan of Rails' code generator either. So you can argue that it's just my taste and I'd agree 😂) |
a578007
to
895b6a6
Compare
This tool is only test skeleton generator so the test author should maintain the test. |
Screen.Recording.2021-06-21.at.3.42.17.PM.mov
What's this?
This is a test generator to make it easier to write tests.
Generate Tests
There is a test generator in
debug.rb
project to make it easier to write tests.Quickstart
This section shows you how to create test file by test generator. For more advanced informations on creating tests, please take a look at gentest options. (You can also check by
$bin/gentest -h
)1. Create a target file for debuggee.
Let's say, we created
target.rb
which is located in top level directory of debugger.2. Run
gentest
as shown in the example below.3. Debugger will be executed. You can type any debug commands.
4. The test file will be created as
test/debug/foo_test.rb
.If the file already exists, only method will be added to it.
gentest options
You can get more information about
gentest
here.The default method name is
test_foo
and the class name isFooTest
. The file name will be[Lowercase letters with "Test" removed from the class name]_test.rb
.