-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create gentest -generate optparser for test-builder
- Loading branch information
ono-max
committed
Jul 5, 2021
1 parent
30038b7
commit 895b6a6
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'optparse' | ||
|
||
require_relative '../test/tool/test_builder' | ||
|
||
file_info = {} | ||
|
||
OptionParser.new do |opt| | ||
opt.banner = 'Usage: bin/gentest [file] [option]' | ||
opt.on('-m METHOD', 'Method name in the test file') do |m| | ||
file_info[:method] = m | ||
end | ||
opt.on('-c CLASS', 'Class name in the test file') do |c| | ||
file_info[:class] = c | ||
end | ||
opt.parse!(ARGV) | ||
end | ||
|
||
exit if ARGV.empty? | ||
|
||
DEBUGGER__::TestBuilder.new(ARGV, file_info[:method], file_info[:class]).start |