diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-25 16:45:18 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-25 16:57:37 +0900 |
commit | 4c1db84d1748b56334da8293ee328186fcb08162 (patch) | |
tree | 14ad13c48d25288b5905cf14d94d5b07ee2100d7 /tool/lib/test | |
parent | f5ea05481017d34a1ebdc0eec32ef10254420ee5 (diff) | |
download | ruby-4c1db84d1748b56334da8293ee328186fcb08162.tar.gz |
Added --base-directory option
Diffstat (limited to 'tool/lib/test')
-rw-r--r-- | tool/lib/test/unit.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 9cded97a33..a3e41a840e 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -856,6 +856,10 @@ module Test def setup_options(parser, options) super parser.separator "globbing options:" + parser.on '-B', '--base-directory DIR', 'Base directory to glob.' do |dir| + raise OptionParser::InvalidArgument, "not a directory: #{dir}" unless File.directory?(dir) + options[:base_directory] = dir + end parser.on '-x', '--exclude REGEXP', 'Exclude test files on pattern.' do |pattern| (options[:reject] ||= []) << pattern end |