Class: Inferno::CLI::Suites

Inherits:
Object
  • Object
show all
Defined in:
lib/inferno/apps/cli/suites.rb

Instance Method Summary collapse

Instance Method Details

#runObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/inferno/apps/cli/suites.rb', line 4

def run
  require_relative '../../../inferno'

  Inferno::Application.start(:suites)

  suites = Inferno::Repositories::TestSuites.new.all
  suite_hash = suites.each_with_object({}) { |suite, hash| hash[suite.id] = suite.title }

  id_column_length = suite_hash.keys.map(&:length).max + 1
  title_column_length = suite_hash.values.map(&:length).max

  puts "#{'ID'.ljust(id_column_length)}| Title"
  puts "#{'-' * id_column_length}+-#{'-' * title_column_length}"
  suite_hash.each do |id, title|
    puts "#{id.ljust(id_column_length)}| #{title}"
  end
end