Module: SnapCI::ParallelTests::Test::CLIHelper

Extended by:
CLIHelper
Included in:
CLIHelper
Defined in:
lib/snap_ci/parallel_tests/test/cli_helper.rb

Instance Method Summary collapse

Instance Method Details



19
20
21
# File 'lib/snap_ci/parallel_tests/test/cli_helper.rb', line 19

def render_footer(optparser, options)
  optparser.separator "\nRun `ruby -r test/test_helper -e1 --help' for supported Test::Unit or MiniTest options."
end

#render_header(optparser, options) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/snap_ci/parallel_tests/test/cli_helper.rb', line 5

def render_header(optparser, options)
  optparser.banner = <<BANNER
Usage: #{optparser.program_name} [options] [files or directories] [-- [Test::Unit or MiniTest options]]

Example: #{optparser.program_name} test/models test/controllers/foo_controller_test.rb -- --verbose --seed 10
BANNER
end

#render_options(optparser, options) ⇒ Object



13
14
15
16
17
# File 'lib/snap_ci/parallel_tests/test/cli_helper.rb', line 13

def render_options(optparser, options)
  optparser.on('-p', '--pattern [PATTERN]', 'run tests matching this pattern') do |pattern|
    options[:pattern] = /#{pattern}/
  end
end