Skip to content

Commit

Permalink
create gentest -generate optparser for test-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
ono-max committed Jul 1, 2021
1 parent 0622729 commit a578007
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bin/gentest
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

0 comments on commit a578007

Please sign in to comment.